HashLoad / horse

Fast, opinionated, minimalist web framework for Delphi
MIT License
1.17k stars 217 forks source link

Fixed header reading in Apache for Delphi #322

Closed dliocode closed 1 year ago

dliocode commented 1 year ago
uses Horse, Web.HTTPD24Impl;

var
  ApacheModuleData: TApacheModuleData;

exports
  ApacheModuleData name 'apache_horse_module';

begin
  THorse.DefaultModule := @ApacheModuleData;
  THorse.HandlerName := 'apache_horse_module-handle';

  THorse.Get('/ping',
    procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)
    begin
      Res.Send('pong: ' + Req.Headers.Field('CONNECTION').AsString);
    end);

  THorse.Listen;
end.