mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 22:09:45 +02:00
* invert existence and allowed checking
git-svn-id: trunk@39405 -
This commit is contained in:
parent
bebd4483d2
commit
4522494982
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user