CHEF-4086: Use "Host:" header value to construct returned URLs
CHEF-4086: Use "Host:" header value to construct returned URLs

Erchef needs to send back URLs for resources such as cookbook versions,
clients, etc. However, if it sits behind a firewall or a proxy, then it
might not have access to the name the client used to access the server.

This patch creates the base url by using the value set by the client in
the "Hosts:" header. If the value is missing, then it will fallback on
using the webmachine-provided host name.

There are some security concerns with this approach. One way to mitigate
this is by checking the value against a configurable whitelist.

stephenbm/chef-server,charlesjohnson/chef-server,vladuemilian/chef-server,rmoorman/chef-server,chef/oc_erchef,charlesjohnson/chef-server,itmustbejj/chef-server,marcparadise/chef-server,itmustbejj/chef-server,stephenbm/chef-server,vladuemilian/chef-server,itmustbejj/chef-server,chef/chef-server,Minerapp/chef-server,rmoorman/chef-server,poliva83/chef-server,chef/chef-server,vladuemilian/chef-server,juliandunn/chef-server-1,chef/chef-server,Minerapp/chef-server,chef/chef-server,vladuemilian/chef-server,rmoorman/chef-server,juliandunn/chef-server-1,marcparadise/chef-server,itmustbejj/chef-server,itmustbejj/chef-server,juliandunn/chef-server-1,rmoorman/chef-server,charlesjohnson/chef-server,stephenbm/chef-server,charlesjohnson/chef-server,charlesjohnson/chef-server,chef/oc_erchef,rmoorman/chef-server,chef/chef-server,poliva83/chef-server,poliva83/chef-server,Minerapp/chef-server,poliva83/chef-server,stephenbm/chef-server,stephenbm/chef-server,marcparadise/chef-server,poliva83/chef-server,chef/oc_erchef,chef/oc_erchef,juliandunn/chef-server-1,Minerapp/chef-server,juliandunn/chef-server-1,chef/chef-server,vladuemilian/chef-server,Minerapp/chef-server,marcparadise/chef-server,marcparadise/chef-server,chef/oc_chef_wm