* invert existence and allowed checking

git-svn-id: trunk@39405 -
This commit is contained in:
michael 2018-07-07 14:08:36 +00:00
parent bebd4483d2
commit 4522494982

View File

@ -266,20 +266,20 @@ begin
exit;
end;
FN:=MapFileName(RFN);
if (FN='') or not FileExists(FN) then
begin
AResponse.Code:=404;
AResponse.CodeText:='Not found';
AResponse.SendContent;
exit;
end;
if not AllowFile(FN) then
if (FN='') or not AllowFile(FN) then
begin
AResponse.Code:=403;
AResponse.CodeText:='Forbidden';
AResponse.SendContent;
exit;
end;
if not FileExists(FN) then
begin
AResponse.Code:=404;
AResponse.CodeText:='Not found';
AResponse.SendContent;
exit;
end;
SendFile(FN,AResponse);
end;