-
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
Mojo::UserAgent can't open https://www.justhappy.fr #1248
Comments
It's very easy to see what's going on with |
Reading the specs (snipped here) I think that the logical action is that in Mojo::Content::parse if no Content-Length header was received and not in one of the listed special cases, then we set With relaxed manually set the body is indeed processed as seen by running perl -Mojo -E 'my $ua = app->ua; my $tx = $ua->build_tx(GET => "https://www.justhappy.fr"); $tx->res->content->relaxed(1); $ua->start($tx); print $tx->res->body' |
The following script could be the base for the corresponding test. It doesn't pass because there is not Content-Length header in the server answer.
The test script will pass whith the current version of Mojo::UserAgent if you manually insert the rigth header:
among the other headers in the $ans variable, as it is in the example taken from RFC 7230 section 2.1. |
Fyi it should be pointed out, that, when using curl, the alproxy sends the Content-Length Header.
Request: > GET / HTTP/1.1 > Host: www.justhappy.fr > User-Agent: curl/7.61.0 > Accept: */* Answer snippet: { [5 bytes data] < HTTP/1.1 200 OK < Content-Type: text/html; charset=utf-8 < Content-Length: 104807 < Vary: Accept-Encoding < ETag: W/"f82d9172eb1954092555394d2709a09c" < Cache-Control: max-age=0, private, must-revalidate < Set-Cookie: < X-Request-Id: 73f47387-cbce-4050-9658-d14995093525 < Via: 1.1 alproxy < Date: Wed, 08 Aug 2018 05:27:58 GMT < |
This seems to be a problem with our empty HTTP response detection code. It works if we remove the
expect_close
attribute. But that of course results in a few existing tests breaking and doesn't seem exactly compatible with the HTTP spec. This RFC section seems related.The text was updated successfully, but these errors were encountered: