gzipped data is coming through funny
- Dominant language
- Julia
- Stars
- 8
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
I would expect the following script to have the same output as `curl -H "Accept-Encoding: gzip" https://api.github.com:443/repos/JuliaWeb/GnuTLS.jl/git/refs/heads/master`. But it seems to be quite different. They have a similar length 184 bytes vs 189 but otherwise completely different. If I remove the "Accept-Encoding: gzip" header the results match up.
``` julia
using GnuTLS
sess = GnuTLS.Session()
set_priority_string!(sess)
set_credentials!(sess, GnuTLS.CertificateStore())
associate_stream(sess, connect("api.github.com", 443))
handshake!(sess)
write(sess, """GET /repos/JuliaWeb/GnuTLS.jl/git/refs/heads/master HTTP/1.1\r
User-Agent: Julia/$VERSION\r
Host: api.github.com\r
Accept: */*\r
Accept-Encoding: gzip\r
\r
""")
readuntil(sess, "\r\n\r\n")
while !eof(sess)
write(STDOUT, read(sess, Uint8))
end
```
[](https://www.bountysource.com/issues/7632539-gzipped-data-is-coming-through-funny?utm_source=7632539&utm_medium=shield&utm_campaign=ISSUE_BADGE)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the provided Julia script and comparing its gzip response with the matching curl request, both with and without the Accept-Encoding header. Trace the GnuTLS session read path involved after the HTTP headers are consumed; done means the gzip-enabled response matches curl rather than producing different bytes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100