-
Notifications
You must be signed in to change notification settings - Fork 33
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
Clarification with SERVER_PORT #45
Comments
You meant the WSGI spec.
I don't think there's a conflict, and you're reading the Plack example code wrong - the code in question uses HTTP_HOST in its entirety, and not use SERVER_PORT. I know the amount of parentheses might be confusing you.
which is the same as:
|
Wow, you got me with those parens. One point for that one +1. Ok so the Plack and PSGI spec are in line. I guess if you want to write a server that works on different systems, CGI and PSGI for example you'll have to have different branches because they're incompatible specs for port resolution (psgi using |
I don't believe they're necessarily incompatible but if that's the case it's a job for the CGI-PSGI adapter to adjust these environment variables as needed, since it's clearly specified in the PSGI spec. |
PEP3333 has been updated to clarify (on WSGI side): python/peps@5f16dd9 |
You linked to your fork, which is not exactly what was merged as I see it. As stated in the PR above by the author, "violation of the CGI spec" doesn't really reflect what we need to do in the real world, since the CGI spec was written before virtual hosting with Host header became universal, and before it becomes more common to put reverse proxy/frontend web servers in front of the backend. I'll only accept PRs similar to above for clarifications, but not actually changing the requirement for URL reconstruction. |
Yep, wrong link my bad. You found the right one. |
The PSGI spec doesn't mention using
HTTP_HOST
in preference toSERVER_PORT
. JustSERVER_NAME
The code for Plack uses
SERVER_PORT
only to source the port..What should happen if the
HTTP_HOST
is "127.0.0.1:12345" and theSERVER_PORT
is "54321" (ie, if they conflict). The WSGI spec has pseudo code in it which takesHTTP_HOST
(ie conflicts with Plack as I read it). I've linked a request for clarification on PEP 333 below.The text was updated successfully, but these errors were encountered: