Ver Fonte

[httpServer] some fixes

Exilon há 5 anos atrás
pai
commit
94bd6cfd3b
2 ficheiros alterados com 2 adições e 2 exclusões
  1. 1 1
      Quick.HttpServer.Types.pas
  2. 1 1
      Quick.HttpServer.pas

+ 1 - 1
Quick.HttpServer.Types.pas

@@ -550,7 +550,7 @@ end;
 constructor EControlledException.Create(aCaller: TObject; aMessage: string);
 begin
   inherited Create(aMessage);
-  fCallerClass := aCaller.ClassType;
+  if aCaller <> nil then fCallerClass := aCaller.ClassType;
 end;
 
 initialization

+ 1 - 1
Quick.HttpServer.pas

@@ -218,7 +218,7 @@ begin
   begin
     if not StrInArray(aRequestInfo.RawHeaders.Names[i],['Host','Accept-Encoding','Accept','User-Agent','Connection','Cache-Control']) then
     begin
-      Result.Headers.Add(aRequestInfo.RawHeaders.Names[i],aRequestInfo.RawHeaders.ValueFromIndex[i]);
+      Result.Headers.Add(aRequestInfo.RawHeaders.Names[i],aRequestInfo.RawHeaders.Values[aRequestInfo.RawHeaders.Names[i]]);
     end;
   end;
 end;