facebook/tornado — pull request #695 by evanj (2013-03-12 20:27:00+00:00)
Title: httpserver: If no X-Scheme header, use the normal request value.

We ran into this problem when testing OAuth redirects on local development servers. In production, we use a reverse proxy. In testing, we use a local development server. It was always generating a redirect to http://localhost instead of https://localhost because of this issue.

Commit message:

Previously, if xheaders is True and there are no X headers passed (e.g. when
developing locally), scheme was always "http". This makes in "http" or
"https", based on what was actually used for the request.

Add tests for the X-Scheme and X-Forwarded-Proto headers.