-
Notifications
You must be signed in to change notification settings - Fork 46
No addr needed for accept #107
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
Conversation
@jbr I was looking through the http/1.1 RFC and couldn't find the section explaining this. Do you have a reference? It's probably worth adding a comment with a link to that section inside the source as well for future reference. edit: Also worth pointing out that this would prevent us from adding HTTP/1.0 support since the HOST Header would not be required there. edit: confusingly RFC 2616 does mention HOST header fields being required by clients to be sent (ref) but that is not mentioned in RFC 7231 which obsoletes RFC 2616. It's also not mentioned in the "changes from 2616" section so I'm assuming both RFCs need to be read in order to understand the full protocol (or maybe it's mentioned in RFC 7231 but still missing it). edit: there we go, RFC 7231 refers to RFC 7230 which specifically covers HTTP headers and includes this section. We should probably link to this from the source (: |
and also add some tests
Added a comment url to the rfc in 0999baf as well. As far as this being an incompatible change for potential http/1.0 support later: I did consider that and should have typed up my thinking on it. I anticipate that adding 1.0 support will be a substantial refactor with any number of interface changes and that in somewhat extreme-programming/yagni fashion, we not try to anticipate the shape of those changes until someone is actually looking at making that change. Even for http/1.0, it doesn't seem like the locally-bound ip and port (or filesystem socket) is the appropriate default for the url base, and it's possible that the domain would need to be provided as an explicit and distinct configuration option by the user, like "listen on 0.0.0.0:3000, but use a default url base of example.com," especially since some 12-factor type deployments will likely want to configure those two settings independently through an env var. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning in this PR is sound; I like these changes. Also it'll make building #104 substantially easier!
because the host header is mandatory for http/1.1, the addr argument to accept is unnecessary and unused. this builds upon #106