Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix api_base URL scheme to detect SSL #189

Open
migurski opened this issue Feb 4, 2015 · 5 comments
Open

Fix api_base URL scheme to detect SSL #189

migurski opened this issue Feb 4, 2015 · 5 comments

Comments

@migurski
Copy link

migurski commented Feb 4, 2015

URLs in the API docs say http:// even on an SSL page. We’ll need to revisit the use of request.scheme in app.py so it correctly picks up the new schema for display, even when proxied behind Apache.

Context in https://github.com/codeforamerica/codeforamerica.org/issues/529#issuecomment-72798885.

@ondrae
Copy link
Collaborator

ondrae commented Feb 4, 2015

@tmaybe and I have been tracing this out.

There is a clue at http://stackoverflow.com/a/24920818/722860 about making an addition to Apache. @migurski What say you?

@tmaybe
Copy link
Collaborator

tmaybe commented Feb 4, 2015

here are the current headers we're getting on an https request (I removed Cookie and User-Agent):

X-Forwarded-Port: 80
X-Forwarded-For: 69.12.169.82, 54.234.33.69
Pragma: no-cache
X-Request-Id: cc29f5ca-f65c-43f6-882b-f9654450ba47
X-Request-Start: 1423091731285
X-Forwarded-Proto: http
X-Forwarded-Server: codeforamerica.org
Cache-Control: no-cache
Accept-Language: en-US,en;q=0.8,id;q=0.6
Host: www.codeforamerica.org
Accept-Encoding: gzip, deflate, sdch
Via: 1.1 vegur
Total-Route-Time: 0
Connect-Time: 0
Connection: close
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Gecko) Chrome/40.0.2214.91 Safari/537.36

@tmaybe
Copy link
Collaborator

tmaybe commented Feb 4, 2015

See also: http://flask.pocoo.org/snippets/35/

@migurski
Copy link
Author

migurski commented Feb 5, 2015 via email

@tmaybe
Copy link
Collaborator

tmaybe commented Feb 5, 2015

yeah! let's do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants