Browse Source

* Set NameValueSeparator both on request and response (so response Location is read correctly)

git-svn-id: trunk@34063 -
michael 9 years ago
parent
commit
af66f2f984
1 changed files with 11 additions and 4 deletions
  1. 11 4
      packages/fcl-web/src/base/fphttpwebclient.pp

+ 11 - 4
packages/fcl-web/src/base/fphttpwebclient.pp

@@ -113,9 +113,16 @@ end;
 { TFPHTTPWebClient }
 { TFPHTTPWebClient }
 
 
 Function TFPHTTPWebClient.DoCreateRequest: TWebClientRequest;
 Function TFPHTTPWebClient.DoCreateRequest: TWebClientRequest;
+
+Var
+  C : TFPHTTPClient;
+
 begin
 begin
-  Result:=TFPHTTPRequest.Create(TFPHTTPClient.Create(Self));
-  Result.Headers.NameValueSeparator:=':';
+  C:=TFPHTTPClient.Create(Self);
+  C.RequestHeaders.NameValueSeparator:=':';
+  C.ResponseHeaders.NameValueSeparator:=':';
+//  C.HTTPversion:='1.0';
+  Result:=TFPHTTPRequest.Create(C);
 end;
 end;
 
 
 Function TFPHTTPWebClient.DoHTTPMethod(Const AMethod, AURL: String;
 Function TFPHTTPWebClient.DoHTTPMethod(Const AMethod, AURL: String;
@@ -124,7 +131,7 @@ Function TFPHTTPWebClient.DoHTTPMethod(Const AMethod, AURL: String;
 Var
 Var
   U,S : String;
   U,S : String;
   h : TFPHTTPClient;
   h : TFPHTTPClient;
-  Res : Boolean;
+
 
 
 begin
 begin
   U:=AURL;
   U:=AURL;
@@ -145,7 +152,7 @@ begin
       H.RequestBody:=ARequest.Content;
       H.RequestBody:=ARequest.Content;
       H.RequestBody.Position:=0;
       H.RequestBody.Position:=0;
       end;
       end;
-    H.HTTPMethod(AMethod,U,Result.Content,[]); // Will rais an exception
+    H.HTTPMethod(AMethod,U,Result.Content,[]); // Will raise an exception
   except
   except
     FreeAndNil(Result);
     FreeAndNil(Result);
     Raise;
     Raise;