valenok/mongoose — pull request #119 by lego12239 (2013-03-04 10:42:01+00:00)
Title: Added get_server_name_from_headers option.

If this option is set to yes (by default - "no"), then
SERVER_NAME environment variable (that used by cgi) set to a value of
Host http header.

This is need for cgi scripts, when a redirection uri is constructed from SERVER_NAME, SERVER_PORT and SCRIPT_NAME and a box with mongoose has several interfaces, for example. So, it wrong to set SERVER_NAME to one domain or IP. If user requests 192.168.0.1, then he must receive a redirection uri with 192.168.0.1; if user requests my-box (which is hardcoded in his hosts file), then he must receive a redirection uri with my-box in it. Apache, cherooke etc implement this behaviour.

I don't understand why mongoose get SERVER_NAME value from authentication_domain option, instead of getting it from Host http-header. May be this some security or anything else issue, therefore i added this as an option to make this behaviour switchable.