Fix a PHP error
Determine the request protocol in a different way

Per #273.
Don't forget ://

Per #273.