Sfoglia il codice sorgente

* invert existence and allowed checking

git-svn-id: trunk@39405 -
michael 7 anni fa
parent
commit
4522494982
1 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 6 6
      packages/fcl-web/src/base/fpwebfile.pp

+ 6 - 6
packages/fcl-web/src/base/fpwebfile.pp

@@ -266,17 +266,17 @@ 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
     begin
-    AResponse.Code:=404;
-    AResponse.CodeText:='Not found';
+    AResponse.Code:=403;
+    AResponse.CodeText:='Forbidden';
     AResponse.SendContent;
     AResponse.SendContent;
     exit;
     exit;
     end;
     end;
-  if not AllowFile(FN) then  
+  if  not FileExists(FN) then
     begin
     begin
-    AResponse.Code:=403;
-    AResponse.CodeText:='Forbidden';
+    AResponse.Code:=404;
+    AResponse.CodeText:='Not found';
     AResponse.SendContent;
     AResponse.SendContent;
     exit;
     exit;
     end;
     end;