httpsend.pas - fixed HTTP header decoding

git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@163 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
geby 2012-10-05 10:27:43 +00:00
parent cbc6f6ce1a
commit 9ef95b96cb

View File

@ -1,9 +1,9 @@
{==============================================================================| {==============================================================================|
| Project : Ararat Synapse | 003.012.006 | | Project : Ararat Synapse | 003.012.007 |
|==============================================================================| |==============================================================================|
| Content: HTTP client | | Content: HTTP client |
|==============================================================================| |==============================================================================|
| Copyright (c)1999-2011, Lukas Gebauer | | Copyright (c)1999-2012, Lukas Gebauer |
| All rights reserved. | | All rights reserved. |
| | | |
| Redistribution and use in source and binary forms, with or without | | Redistribution and use in source and binary forms, with or without |
@ -33,7 +33,7 @@
| DAMAGE. | | DAMAGE. |
|==============================================================================| |==============================================================================|
| The Initial Developer of the Original Code is Lukas Gebauer (Czech Republic).| | The Initial Developer of the Original Code is Lukas Gebauer (Czech Republic).|
| Portions created by Lukas Gebauer are Copyright (c) 1999-2011. | | Portions created by Lukas Gebauer are Copyright (c) 1999-2012. |
| All Rights Reserved. | | All Rights Reserved. |
|==============================================================================| |==============================================================================|
| Contributor(s): | | Contributor(s): |
@ -616,15 +616,15 @@ begin
su := UpperCase(s); su := UpperCase(s);
if Pos('CONTENT-LENGTH:', su) = 1 then if Pos('CONTENT-LENGTH:', su) = 1 then
begin begin
Size := StrToIntDef(Trim(SeparateRight(s, ' ')), -1); Size := StrToIntDef(Trim(SeparateRight(s, ':')), -1);
if (Size <> -1) and (FTransferEncoding = TE_UNKNOWN) then if (Size <> -1) and (FTransferEncoding = TE_UNKNOWN) then
FTransferEncoding := TE_IDENTITY; FTransferEncoding := TE_IDENTITY;
end; end;
if Pos('CONTENT-TYPE:', su) = 1 then if Pos('CONTENT-TYPE:', su) = 1 then
FMimeType := Trim(SeparateRight(s, ' ')); FMimeType := Trim(SeparateRight(s, ':'));
if Pos('TRANSFER-ENCODING:', su) = 1 then if Pos('TRANSFER-ENCODING:', su) = 1 then
begin begin
s := Trim(SeparateRight(su, ' ')); s := Trim(SeparateRight(su, ':'));
if Pos('CHUNKED', s) > 0 then if Pos('CHUNKED', s) > 0 then
FTransferEncoding := TE_CHUNKED; FTransferEncoding := TE_CHUNKED;
end; end;