diff options
| author | bptato <nincsnevem662@gmail.com> | 2023-11-17 23:07:10 +0100 |
|---|---|---|
| committer | bptato <nincsnevem662@gmail.com> | 2023-11-17 23:17:39 +0100 |
| commit | 85c5b568510e3be46252a0857e412ef0f66eb6de (patch) | |
| tree | 6c221532931f42d129ac7ec0ac8da8a00a92b59c /src/loader | |
| parent | d454eab33b645e108a8a2dae84bdbcece6f7e877 (diff) | |
| download | chawan-85c5b568510e3be46252a0857e412ef0f66eb6de.tar.gz | |
http: use Accept-Encoding
just ask libcurl to decode
Diffstat (limited to 'src/loader')
| -rw-r--r-- | src/loader/http.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/loader/http.nim b/src/loader/http.nim index f56341f4..d7bc3a8f 100644 --- a/src/loader/http.nim +++ b/src/loader/http.nim @@ -112,6 +112,9 @@ proc loadHttp*(handle: LoaderHandle, curlm: CURLM, curl.setopt(CURLOPT_WRITEFUNCTION, curlWriteBody) curl.setopt(CURLOPT_HEADERDATA, handleData) curl.setopt(CURLOPT_HEADERFUNCTION, curlWriteHeader) + if "Accept-Encoding" in request.headers: + let s = request.headers["Accept-Encoding"] + curl.setopt(CURLOPT_ACCEPT_ENCODING, cstring(s)) if request.proxy != nil: let purl = request.proxy.serialize() curl.setopt(CURLOPT_PROXY, purl) |