Closed picatz closed 5 years ago
It's probably something wrong with protocol-http2
and the remote server is not happy. The best way to debug it is to print out individual frames and see where it goes wrong.
I checked and the issue is the new setting in the h2 websocket rfc. I've added this as a spec... I'm not sure what the solution is yet. Because I don't know if the remote server should ignore settings it doesn't understand. Is that RFC compliant?
So, from what I can see, Hashicorp's HTTP/2 server is in violation of the RFC:
An endpoint that receives a SETTINGS frame with any unknown or unsupported identifier MUST ignore that setting.
Here is the response:
% nghttp -v https://www.hashicorp.com/jobs
[ 0.409] recv (stream_id=13) :status: 200
[ 0.410] recv (stream_id=13) content-type: text/html; charset=utf-8
[ 0.410] recv (stream_id=13) date: Mon, 10 Jun 2019 09:04:18 GMT
[ 0.410] recv (stream_id=13) etag: W/"3681a-z4jCsdHR4CgC6O3MC2v4eWD63DU"
[ 0.410] recv (stream_id=13) server: Netlify
[ 0.410] recv (stream_id=13) strict-transport-security: max-age=15552000; includeSubDomains
[ 0.410] recv (stream_id=13) via: 1.1 vegur
[ 0.410] recv (stream_id=13) x-content-type-options: nosniff
[ 0.410] recv (stream_id=13) x-dns-prefetch-control: off
[ 0.410] recv (stream_id=13) x-download-options: noopen
[ 0.410] recv (stream_id=13) x-frame-options: SAMEORIGIN
[ 0.410] recv (stream_id=13) x-xss-protection: 1; mode=block
[ 0.410] recv (stream_id=13) content-encoding: gzip
[ 0.410] recv (stream_id=13) age: 1
[ 0.410] recv (stream_id=13) vary: Accept-Encoding
[ 0.410] recv (stream_id=13) x-nf-request-id: 488c9482-57ad-4e90-aa63-c9bb980799f4-19530674
[ 0.410] recv HEADERS frame <length=305, flags=0x04, stream_id=13>
So, I don't know what netlify is, but I guess we can try to reach out to them.
I added a spec to track whether the issue is fixed: https://github.com/socketry/async-http/blob/de02ee6eb4febd753989d0049ec37098821d3310/spec/async/http/internet_spec.rb#L51-L55
Netlify is a relatively popular service to deploy static sites. I've tried contacting support via their website -- but I'm worried that won't fix the issue, or at least not very quickly.
I work for Netlify's support and I have brought it up with our Platform team. We'll keep working with @picatz via the helpdesk thread, but I cannot promise a fast resolution.
One presumes he will follow up here as we come to some conclusion :)
Small update: Netlify recognizes that their server is violating the RFC, but it won't be a quick fix.
Issue is fixed by avoiding sending this setting to server. Even if it's in violation of the spec, it wasn't necessary for us to send it, so I've just removed it, and it works.
I came across some weird behavior today that I don't quite know how to manage.
But, I'm getting the following error:
Working Version
The following code using
net/http
doesn't experience the same issue, but I'd rather useasync/http/internet
if possible: