emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/with-url 94b1d02 3/7: Decompress compressed data


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] scratch/with-url 94b1d02 3/7: Decompress compressed data
Date: Sat, 21 Jan 2017 23:08:22 +0000 (UTC)

branch: scratch/with-url
commit 94b1d02d1761326d03df6e0643c405ba62e415b6
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Decompress compressed data
---
 lisp/url/with-url.el |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/url/with-url.el b/lisp/url/with-url.el
index dbd95d5..91414bf 100644
--- a/lisp/url/with-url.el
+++ b/lisp/url/with-url.el
@@ -499,6 +499,11 @@ If given, return the value in BUFFER instead."
       ;; remove the chunk length indicators from the response.
       (when (cl-equalp (url-header 'transfer-encoding) "chunked")
         (with-url--decode-chunked))
+      ;; The contents may be compressed.
+      (when (and (cl-equalp (url-header 'content-encoding) "gzip")
+                 (fboundp 'zlib-available-p)
+                 (zlib-available-p))
+        (zlib-decompress-region (point-min) (point-max)))
       ;; Text responses should have the CRLF things removed.
       (when (string-match "^text/" (or (url-header 'content-type)
                                        "text/html"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]