瀏覽代碼

* invert existence and allowed checking

git-svn-id: trunk@39405 -
michael 7 年之前
父節點
當前提交
4522494982
共有 1 個文件被更改,包括 6 次插入6 次删除
  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;
     end;
   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.Code:=403;
+    AResponse.CodeText:='Forbidden';
     AResponse.SendContent;
     exit;
     end;
-  if not AllowFile(FN) then  
+  if  not FileExists(FN) then
     begin
-    AResponse.Code:=403;
-    AResponse.CodeText:='Forbidden';
+    AResponse.Code:=404;
+    AResponse.CodeText:='Not found';
     AResponse.SendContent;
     exit;
     end;