Fixed Indy to correctly assign request headers

This commit is contained in:
Andreas Schneider 2015-10-06 22:01:27 +02:00
parent 2c8721bc20
commit b260f184f8
3 changed files with 7 additions and 6 deletions

View File

@ -387,6 +387,8 @@ var
jsonData: TJSONData;
contentType: TContentType;
xmlDoc: TXMLDocument;
//
i: Integer;
begin
FParser.Content := AURL;
FParser.Replace;
@ -412,9 +414,6 @@ begin
FHttp.Request := FRequest;
FHttp.HTTPOptions := FHttp.HTTPOptions + [hoNoProtocolErrorException];
// Workaround for CustomHeaders not being assigned :-/
FHttp.Request.CustomHeaders.AddStrings(FRequest.CustomHeaders);
if SameText('POST', FMethod) and (FFormFields.Count > 0) then
FHttp.Post(AURL, FFormFields, response)
else

View File

@ -336,6 +336,7 @@ begin
begin
LDest := TIdEntityHeaderInfo(Destination);
LDest.FRawHeaders.Assign(FRawHeaders);
LDest.FCustomHeaders.Assign(FCustomHeaders);
LDest.FCacheControl := FCacheControl;
LDest.FCharSet := FCharSet;
LDest.FContentDisposition := FContentDisposition;
@ -966,9 +967,9 @@ begin
// TODO: omitted intentionally?
// LDest.FHost := FHost;
// LDest.FProxyConnection := FProxyConnection;
end else begin
inherited AssignTo(Destination);
end;
inherited AssignTo(Destination);
end;
procedure TIdRequestHeaderInfo.Clear;

View File

@ -19,7 +19,8 @@
<VersionInfo>
<UseVersionInfo Value="True"/>
<MinorVersionNr Value="6"/>
<StringTable LegalCopyright="Andreas Schneider" ProductName="restemplate" ProductVersion="0.6.0"/>
<RevisionNr Value="1"/>
<StringTable LegalCopyright="Andreas Schneider" ProductName="restemplate" ProductVersion="0.6.1"/>
</VersionInfo>
<MacroValues Count="1">
<Macro1 Name="LCLWidgetType" Value="nogui"/>