-
Notifications
You must be signed in to change notification settings - Fork 582
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
uninitialized warning issued when stringifying a request #2232
Comments
The undef warning is coming from the host header being undef. I can't find where in the code this header is being set; the first place I've identified where it is set is here:
..but earlier, in Mojo::Message::fix_headers, host is not set. |
According to spec, a host header must be sent with all http 1.1 requests.. I reckon Mojo is following spec somewhere -- like you, I'm curious to learn where! |
The pod shows two ways to construct A request without a url sounds like a zen kōan |
If I do
|
By my reading of https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2-5, a Host header is mandatory, but an empty value is permissible. Therefore we should be doing a definedness check (as in the patch above), not a truthy check. (
|
Seems reasonable. |
RFC9112 §3.2-5 says that Host is mandatory, but can be an empty value. resolves issue mojolicious#2232.
RFC9112 §3.2-5 says that Host is mandatory, but can be an empty value. resolves issue mojolicious#2232.
What am I doing wrong here? This seems like a warning that shouldn't happen...
produces:
This is with Mojolicious 9.39.
The text was updated successfully, but these errors were encountered: