Ignore:
Timestamp:
Sep 9, 2022, 8:20:25 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Removed TemplateGenerics package. Generics usage replaced by standard Generics.Collections.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CoolWeb/WebServer/UHTTPServerCGI.pas

    r137 r138  
    44
    55uses
    6   Classes, SysUtils, UHTTPServer, SpecializedList, IOStream;
     6  Classes, SysUtils, UHTTPServer, IOStream, Generics.Collections;
    77
    88type
     
    5454  Buffer: string;
    5555  Count: Integer;
     56  Item: TPair<string, string>;
    5657begin
    5758  HandlerData := THTTPHandlerData.Create;
     
    9697      EnvVars.Values['QUERY_STRING'] := Copy(EnvVars.Values['QUERY_STRING'], 1,
    9798        Length(EnvVars.Values['QUERY_STRING']) - 1);
    98     Request.Path.Explode(EnvVars.Values['QUERY_STRING'], '/', StrToStr);
     99    Request.Path.Explode('/', EnvVars.Values['QUERY_STRING']);
    99100    if Pos('?', EnvVars.Values['REQUEST_URI']) > 0 then begin
    100101      Request.Query.Parse(Copy(EnvVars.Values['REQUEST_URI'],
     
    129130    with Response do begin
    130131      // Generate cookies
    131       for I := 0 to Cookies.Count - 1 do
    132         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);
    133134        // + ';path=/;expires=' + RFC822DateTime(Now);
    134135
    135136      // Generate headers
    136       for I := 0 to Headers.Count - 1 do begin
    137         WriteLn(Headers.Keys[I] + ': ' + Headers.Items[I].Value);
     137      for Item in Headers do begin
     138        WriteLn(Item.Key + ': ' + Item.Value);
    138139      end;
    139140
Note: See TracChangeset for help on using the changeset viewer.