Fixed Indy to correctly assign request headers
This commit is contained in:
parent
2c8721bc20
commit
b260f184f8
|
@ -387,6 +387,8 @@ var
|
||||||
jsonData: TJSONData;
|
jsonData: TJSONData;
|
||||||
contentType: TContentType;
|
contentType: TContentType;
|
||||||
xmlDoc: TXMLDocument;
|
xmlDoc: TXMLDocument;
|
||||||
|
//
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
FParser.Content := AURL;
|
FParser.Content := AURL;
|
||||||
FParser.Replace;
|
FParser.Replace;
|
||||||
|
@ -412,9 +414,6 @@ begin
|
||||||
FHttp.Request := FRequest;
|
FHttp.Request := FRequest;
|
||||||
FHttp.HTTPOptions := FHttp.HTTPOptions + [hoNoProtocolErrorException];
|
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
|
if SameText('POST', FMethod) and (FFormFields.Count > 0) then
|
||||||
FHttp.Post(AURL, FFormFields, response)
|
FHttp.Post(AURL, FFormFields, response)
|
||||||
else
|
else
|
||||||
|
|
|
@ -336,6 +336,7 @@ begin
|
||||||
begin
|
begin
|
||||||
LDest := TIdEntityHeaderInfo(Destination);
|
LDest := TIdEntityHeaderInfo(Destination);
|
||||||
LDest.FRawHeaders.Assign(FRawHeaders);
|
LDest.FRawHeaders.Assign(FRawHeaders);
|
||||||
|
LDest.FCustomHeaders.Assign(FCustomHeaders);
|
||||||
LDest.FCacheControl := FCacheControl;
|
LDest.FCacheControl := FCacheControl;
|
||||||
LDest.FCharSet := FCharSet;
|
LDest.FCharSet := FCharSet;
|
||||||
LDest.FContentDisposition := FContentDisposition;
|
LDest.FContentDisposition := FContentDisposition;
|
||||||
|
@ -966,9 +967,9 @@ begin
|
||||||
// TODO: omitted intentionally?
|
// TODO: omitted intentionally?
|
||||||
// LDest.FHost := FHost;
|
// LDest.FHost := FHost;
|
||||||
// LDest.FProxyConnection := FProxyConnection;
|
// LDest.FProxyConnection := FProxyConnection;
|
||||||
end else begin
|
|
||||||
inherited AssignTo(Destination);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
inherited AssignTo(Destination);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIdRequestHeaderInfo.Clear;
|
procedure TIdRequestHeaderInfo.Clear;
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<UseVersionInfo Value="True"/>
|
<UseVersionInfo Value="True"/>
|
||||||
<MinorVersionNr Value="6"/>
|
<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>
|
</VersionInfo>
|
||||||
<MacroValues Count="1">
|
<MacroValues Count="1">
|
||||||
<Macro1 Name="LCLWidgetType" Value="nogui"/>
|
<Macro1 Name="LCLWidgetType" Value="nogui"/>
|
||||||
|
|
Loading…
Reference in New Issue