Browse Source

* Fix loadfromstrings, fixes bug #40929

Michael Van Canneyt 10 months ago
parent
commit
5b46c44b7d
1 changed files with 6 additions and 3 deletions
  1. 6 3
      packages/fcl-web/src/base/httpdefs.pp

+ 6 - 3
packages/fcl-web/src/base/httpdefs.pp

@@ -1921,8 +1921,10 @@ begin
         VN:=Copy(S,1,P-1);
         Delete(S,1,P);
         P:=GetFieldNameIndex(VN);
-        If (P<>-1) then
-          SetFieldValue(P,S);
+        If (P<>0) then                     // Changed -1 in 0
+          SetFieldValue(P,trim(S))         // Added TRIM
+        else                               // Added else
+          SetCustomHeader(VN, trim(S));
         end;
       Inc(Result);
       end;
@@ -2292,7 +2294,8 @@ begin
   begin
     FHttpVersion := Copy(URI, i + 1, Length(URI));
     URI := Copy(URI, 1, i - 1);
-    FHttpVersion := Copy(HttpVersion, Pos('/', HttpVersion) + 1, Length(HttpVersion));
+    FHttpVersion := Copy(FHttpVersion, Pos('/', FHttpVersion) + 1, Length(FHttpVersion)); // Changed HttpVersion in HttpVersion
+    HTTPVersion:= FHttpVersion;
   end;
 
   // Extract query string