Browse Source

* Fix appending path info and setting headers

git-svn-id: trunk@43060 -
michael 5 years ago
parent
commit
43685c95a8
1 changed files with 8 additions and 4 deletions
  1. 8 4
      packages/fcl-web/src/base/fpwebproxy.pp

+ 8 - 4
packages/fcl-web/src/base/fpwebproxy.pp

@@ -239,7 +239,7 @@ end;
 procedure TProxyWebModule.ClientToResponse(T : TFPHTTPClient; aResponse : TResponse);
 
 Var
-  N,H : String;
+  N,H,V : String;
   HT : THeader;
 
 begin
@@ -249,8 +249,9 @@ begin
     HT:=HeaderType(H);
     if not (HT in [hhContentLength]) then
       begin
+      V:=Trim(ExtractWord(2,N,[':']));
       {$IFDEF DEBUGPROXY}Writeln('Returning header: ',N);{$ENDIF}
-      AResponse.CustomHeaders.Add(N);
+      AResponse.SetCustomHeader(H,V);
       end;
     end;
   AResponse.Code:=T.ResponseStatusCode;
@@ -268,9 +269,12 @@ begin
   URL:=L.URL;
   if L.AppendPathInfo then
     begin
-    P:=ARequest.PathInfo;
-    if (P<>'') then
+    P:=ARequest.GetNextPathInfo;
+    While P<>'' do
+      begin
       URL:=IncludeHTTPPathDelimiter(URL)+P;
+      P:=ARequest.GetNextPathInfo;
+      end;
     end;
   if (ARequest.QueryString<>'') then
     URL:=URL+'?'+ARequest.QueryString;