liftopia/hipache — pull request #3 by amdtech (2014-02-19 01:47:33+00:00)
Title: [#64844520] Add backend host header support

Work towards resolving the rolodex-on-heroku CSRF issue, as well as a fix to get smartling proxying capabilities.

Tagging @doomspork for review, @paultannenbaum / @bdoms for javascript chops (if you can think of more efficient ways of accomplishing these things, lemme know).

Some demonstration of how it works... in particular this allows us to front any domain with our proxy system:
```
aaron-mba:rtopia aaron$ curl -i 'http://localhost:8081/services/products/1395?store=105¤cy=CAD&from=2014-04-18' -H 'Host: fr-ca.liftopia.tv' -H 'x-debug: true'
HTTP/1.1 200 OK
cache-control: max-age=0, private, must-revalidate
content-type: application/json; charset=utf-8
date: Wed, 19 Feb 2014 01:44:54 GMT
etag: "72242b31481fe3ba9757a84205593253"
server: nginx
set-cookie: AWSELB=FF41C189107B39B41E95FFD3EF2EB900C9873E5E0C19119A5D6191D733FB2E865696138E3225B590DC61AA869D50EA658F738FF5E0A96449F51D144688DEBADF963822FC77;PATH=/;MAX-AGE=120
status: 200 OK
vary: Accept-Encoding
x-request-id: 77a67d917f7b54aef2e8d17821a46395
x-runtime: 0.273540
x-server: Smartling
x-ua-compatible: IE=Edge,chrome=1
transfer-encoding: chunked
connection: Close
x-debug-version-hipache: 0.2.5
x-debug-backend-url: http://liftopia-tv.sl.smartling.com:80/
x-debug-backend-id: 0
x-debug-vhost: fr-ca.liftopia.tv
x-debug-frontend-key: fr-ca.liftopia.tv
x-debug-time-total: 692
x-debug-time-backend: 691

{}
```