2
0
Эх сурвалжийг харах

* Merging revisions r42871,r42872 from trunk:
------------------------------------------------------------------------
r42871 | michael | 2019-08-29 21:02:08 +0200 (Thu, 29 Aug 2019) | 1 line

* Fix forgotten loadmimetypes
------------------------------------------------------------------------
r42872 | michael | 2019-08-29 21:07:52 +0200 (Thu, 29 Aug 2019) | 1 line

* Observe -m
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@42873 -

michael 6 жил өмнө
parent
commit
810989c765

+ 4 - 1
packages/fcl-web/examples/simpleserver/simpleserver.pas

@@ -71,10 +71,12 @@ begin
     MimeTypesFile:=GetOptionValue('m','mimetypes');
     MimeTypesFile:=GetOptionValue('m','mimetypes');
     if (MimeTypesFile<>'') and not FileExists(MimeTypesFile) then
     if (MimeTypesFile<>'') and not FileExists(MimeTypesFile) then
       begin
       begin
-      MimeTypesFile:='';
       Log(etWarning,'mimetypes file not found: '+MimeTypesFile);
       Log(etWarning,'mimetypes file not found: '+MimeTypesFile);
+      MimeTypesFile:='';
       end;
       end;
     end;
     end;
+  If MimeTypesFile<>'' then
+    MimeTypes.LoadFromFile(MimeTypesFile);  
 end;
 end;
 
 
 procedure THTTPApplication.DoRun;
 procedure THTTPApplication.DoRun;
@@ -88,6 +90,7 @@ begin
     usage(S);
     usage(S);
   Quiet:=HasOption('q','quiet');
   Quiet:=HasOption('q','quiet');
   Port:=StrToIntDef(GetOptionValue('p','port'),3000);
   Port:=StrToIntDef(GetOptionValue('p','port'),3000);
+  LoadMimeTypes;
   D:=GetOptionValue('d','directory');
   D:=GetOptionValue('d','directory');
   if D='' then
   if D='' then
     D:=GetCurrentDir;
     D:=GetCurrentDir;