Skip to content

Commit

Permalink
fix empty response bug due to FileExists behavior in FPC 3.0.4
Browse files Browse the repository at this point in the history
This commit fixes bug which cause empty response in FPC 3.0.4 due to behavior of FileExists that returns true when input is directory name
  • Loading branch information
zamronypj committed Dec 9, 2022
1 parent 9a5966f commit 076846e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ THttpServerThread = class(TThread)
DoDirSeparators(url);
fname := fSvrConfig.documentRoot + url;
isStaticFileRequest := ((method = 'GET') or (method = 'HEAD')) and
fileExists(fname);
fileExists(fname) and (not directoryExists(fname));

if isStaticFileRequest then
begin
Expand Down

0 comments on commit 076846e

Please sign in to comment.