Skip to content

Commit

Permalink
set HTTP_HOST properly for CGI
Browse files Browse the repository at this point in the history
Set HTTP_HOST to the value of the HTTP Host header, rather than just
setting it to the server hostname. Thanks to Roman Arefiev for
tracking down the fact that HTTP_HOST was set incorrectly.
  • Loading branch information
vinoski committed Apr 18, 2011
1 parent 4aa146b commit f74f67a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/yaws_cgi.erl
Expand Up @@ -266,7 +266,7 @@ build_env(Arg, Scriptfilename, Pathinfo, ExtraEnv, SC) ->
([
{"SERVER_SOFTWARE", "Yaws/"++yaws_generated:version()},
{"SERVER_NAME", Hostname},
{"HTTP_HOST", Hostname},
{"HTTP_HOST", checkdef(H#headers.host)},
{"GATEWAY_INTERFACE", "CGI/1.1"},
{"SERVER_PROTOCOL", "HTTP/" ++ integer_to_list(Maj) ++
"." ++ integer_to_list(Min)},
Expand Down

0 comments on commit f74f67a

Please sign in to comment.