rembo10/headphones — pull request #768 by bennullgraham (2012-08-02 07:32:24+00:00)
Title: Header-based HTTPS Redirect

Refs Issue #749

This change allows CherryPy to redirect using the appropriate scheme (http/https) based on information a proxying webserver can add to the request header.

Turns out CherryPy has a built-in tool for handling this situation. `cherrypy.tools.proxy` pays attention to either `X-Forwarded-Ssl: on` or `X-Forwarded-Proto: https` in the request header. An Apache proxy config setting that header would look like:
```apache
RequestHeader add X-Forwarded-Proto https
```

A lot of overhead for a one-line change. Initally seemed like more code would be required.