Changeset 138 for trunk/Packages/CoolWeb/WebServer/UHTTPServerCGI.pas
- Timestamp:
- Sep 9, 2022, 8:20:25 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CoolWeb/WebServer/UHTTPServerCGI.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, UHTTPServer, SpecializedList, IOStream;6 Classes, SysUtils, UHTTPServer, IOStream, Generics.Collections; 7 7 8 8 type … … 54 54 Buffer: string; 55 55 Count: Integer; 56 Item: TPair<string, string>; 56 57 begin 57 58 HandlerData := THTTPHandlerData.Create; … … 96 97 EnvVars.Values['QUERY_STRING'] := Copy(EnvVars.Values['QUERY_STRING'], 1, 97 98 Length(EnvVars.Values['QUERY_STRING']) - 1); 98 Request.Path.Explode( EnvVars.Values['QUERY_STRING'], '/', StrToStr);99 Request.Path.Explode('/', EnvVars.Values['QUERY_STRING']); 99 100 if Pos('?', EnvVars.Values['REQUEST_URI']) > 0 then begin 100 101 Request.Query.Parse(Copy(EnvVars.Values['REQUEST_URI'], … … 129 130 with Response do begin 130 131 // Generate cookies 131 for I := 0 to Cookies.Count - 1do132 Headers.Add('Set-Cookie', Cookies.Keys[I] + '=' + Cookies.Items[I].Value);132 for Item in Cookies do 133 Headers.Add('Set-Cookie', Item.Key + '=' + Item.Value); 133 134 // + ';path=/;expires=' + RFC822DateTime(Now); 134 135 135 136 // Generate headers 136 for I := 0 to Headers.Count - 1do begin137 WriteLn( Headers.Keys[I] + ': ' + Headers.Items[I].Value);137 for Item in Headers do begin 138 WriteLn(Item.Key + ': ' + Item.Value); 138 139 end; 139 140
Note:
See TracChangeset
for help on using the changeset viewer.