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

Fixes to bring this up to CGI/1.1 specification #112

Merged

Conversation

technosophos
Copy link
Contributor

During investigation of #101, I found several fairly major discrepancies between Wagi and the CGI/1.1 specification. This fixes the following:

  • SCRIPT_NAME is now correctly the path too the handler route (route minus /...)
  • PATH_INFO is now correctly the path added after the handler route (e.g. whatever matched /...)
  • PATH_TRANSLATED is now correctly the URL-decoded value of PATH_INFO
  • The Status parser now allows there to be a message in addition to the code (e.g. Status 404 Not Found). However, the message is ignored, and the standard messages are used.

Additionally:

  • X_RELATIVE_PATH has been removed, replaced by PATH_INFO
  • While the spec does not allow for a Status without a Content-Type, I easily discovered cases in the wild where a CGI returned Status, and neither a body nor a Content-Type. We now allow this (which makes sense).

Docs were updated accordingly

Closes #101

Signed-off-by: Matt Butcher matt.butcher@microsoft.com

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
# The value of the HTTP Accept header from the client. This could be empty.
HTTP_ACCEPT="*/*"
# The HTTP method (GET/POST/PUT/etc) sent by the client
REQUEST_METHOD="GET"
# The protocol that the server is using. Normally this is "http" or "https"
SERVER_PROTOCOL="http"
# The protocol that the server is using. Usually it is HTTP/1.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention it is always HTTP/1.1 for now?
Do we want to add a note in the docs about HTTP/2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I am going to leave it just b/c I know that Wagi.net points to these docs in some places. And IIRC, it can do HTTP/2

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

Successfully merging this pull request may close these issues.

None yet

2 participants