lua-http icon indicating copy to clipboard operation
lua-http copied to clipboard

Possible HTTP/2 Incompatibility

Open sparked435 opened this issue 1 year ago • 3 comments

This might not be a lua-http issue; but only lua-http shows this behavior on sites using the Fastly CDN. The following works, outputting "200", as expected:

local req = httpreq.new_from_uri( 'https://www.bbc.com/robots.txt' ) req.version = 1

local headers, body = req:go(5) print(headers:get(':status'))

Switching req.version to either nil or 2 returns a 403. I spent some time ensuring Curl and lua-http were sending identical headers; lua-http gets 403 for HTTP/2 and Curl always gets a 200 regardless of version. Web browsers consistently succeed as well.

Environment is Lua 5.4, lua-http 0.4, cqueues 20200726.54, and luaossl 20220711.

sparked435 avatar May 29 '24 16:05 sparked435