Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 13 of 13 total
Thread Dirty Server Request's ResponseHeaders
Mon, Jan 7 2019 11:07 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< OMG, I must have not quite recovered after a severe flu, only by this I can explain the fact that I did not notice that Trim applies only to the values of the headers, not to their names. >>

I've added a Trim call around the getAllResponseHeaders call, and that should resolve this.  For a hot fix:

procedure TServerRequest.Complete(Cancelled: Boolean=False;
                                 KeepExecuting: Boolean=True);
var
  I: Integer;
begin
  try
     if KeepExecuting then
        begin
        {$IFNDEF DESIGN}
        FResponseHeaders.Text:=Trim(FHttpRequest.getAllResponseHeaders); <<<<<<<<<<<<<<<<
        {$ENDIF}
        { Clean up response header values in case they contain leading spaces }
        for I:=0 to FResponseHeaders.Count-1 do
           FResponseHeaders.ValueFromIndex[I]:=Trim(FResponseHeaders.ValueFromIndex[I]);
….

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Jan 7 2019 11:36 AMPermanent Link

ooptimum

Tim Young [Elevate Software] wrote:

<< I've added a Trim call around the getAllResponseHeaders call, and that should resolve this. >>

Thank you.

I now think about what would happen if any ancient server sends a header wrapped onto the next line, because it's not prohibited although it's not encouraged.
Thu, Jan 17 2019 11:42 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< I now think about what would happen if any ancient server sends a header wrapped onto the next line, because it's not prohibited although it's not encouraged. >>

I don't think a Trim() would have any effect on multi-line headers, other than the first/last CR/LF.

Tim Young
Elevate Software
www.elevatesoft.com
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image