Permalink
Browse files

allow caller to set Host header for SOAP requests

  • Loading branch information...
1 parent d4fec79 commit 28f44b0ba248ee8c8f5d31628e9351c69dd93fc4 @vinoski vinoski committed Feb 6, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/yaws_soap_lib.erl
View
@@ -419,7 +419,13 @@ http_request(URL, SoapAction, Request, Options, Headers, ContentType) ->
end.
inets_request(URL, SoapAction, Request, Options, Headers, ContentType) ->
- NewHeaders = [{"Host", "localhost:8800"}, {"SOAPAction", SoapAction}|Headers],
+ NHeaders = [{"SOAPAction", SoapAction}|Headers],
+ NewHeaders = case proplists:get_value("Host", NHeaders) of
+ undefined ->
+ [{"Host", "localhost:8800"}|NHeaders];
+ _ ->
+ NHeaders
+ end,
NewOptions = [{cookies, enabled}|Options],
http:set_options(NewOptions),
case http:request(post,

0 comments on commit 28f44b0

Please sign in to comment.