mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 08:49:25 +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;
|
exit;
|
||||||
end;
|
end;
|
||||||
FN:=MapFileName(RFN);
|
FN:=MapFileName(RFN);
|
||||||
if (FN='') or not FileExists(FN) then
|
if (FN='') or not AllowFile(FN) then
|
||||||
begin
|
|
||||||
AResponse.Code:=404;
|
|
||||||
AResponse.CodeText:='Not found';
|
|
||||||
AResponse.SendContent;
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
if not AllowFile(FN) then
|
|
||||||
begin
|
begin
|
||||||
AResponse.Code:=403;
|
AResponse.Code:=403;
|
||||||
AResponse.CodeText:='Forbidden';
|
AResponse.CodeText:='Forbidden';
|
||||||
AResponse.SendContent;
|
AResponse.SendContent;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
if not FileExists(FN) then
|
||||||
|
begin
|
||||||
|
AResponse.Code:=404;
|
||||||
|
AResponse.CodeText:='Not found';
|
||||||
|
AResponse.SendContent;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
SendFile(FN,AResponse);
|
SendFile(FN,AResponse);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user