Luracast/Restler — pull request #206 by travisaustin (2013-09-30 17:38:36+00:00)
Title: Added support for Resources.json recognizing HTTPS when behind Amazon Elastic Load Balancer

AWS ELB can present an HTTPS interface to the public but communicate to its backend servers via HTTP. When this occurs, the client's browser thinks all traffic is via HTTPS, but the backend server thinks all traffic is via HTTP. To provide a method for backend servers to recognize the front-end protocol, Amazon provides a header "HTTP_X_FORWARDED_PROTO".

This commit recognizes the Amazon header and correctly sets Restler::$baseUrl to an https:// address when traffic is received via HTTP but the client is communicating to an HTTPS load balancer.

Without this patch, Restler (specifically, Resources.json and Swagger) does not work correctly when behind an Amazon Elastic Load Balancer that is providing SSL offloading.