Browse Source

[httpServer] some fixes

Exilon 5 years ago
parent
commit
94bd6cfd3b
2 changed files with 2 additions and 2 deletions
  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);
 constructor EControlledException.Create(aCaller: TObject; aMessage: string);
 begin
 begin
   inherited Create(aMessage);
   inherited Create(aMessage);
-  fCallerClass := aCaller.ClassType;
+  if aCaller <> nil then fCallerClass := aCaller.ClassType;
 end;
 end;
 
 
 initialization
 initialization

+ 1 - 1
Quick.HttpServer.pas

@@ -218,7 +218,7 @@ begin
   begin
   begin
     if not StrInArray(aRequestInfo.RawHeaders.Names[i],['Host','Accept-Encoding','Accept','User-Agent','Connection','Cache-Control']) then
     if not StrInArray(aRequestInfo.RawHeaders.Names[i],['Host','Accept-Encoding','Accept','User-Agent','Connection','Cache-Control']) then
     begin
     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;
   end;
 end;
 end;