Fixes #733 - parse x-forwarded-proto in a more generally compatibly way