]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow url-insert-file-contents to work on 304 responses
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 24 Sep 2019 08:43:28 +0000 (10:43 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 24 Sep 2019 08:43:32 +0000 (10:43 +0200)
* lisp/url/url-http.el (url-http--insert-file-helper): If the
server answers 304 Not modified, then that's not an error
(bug#26063).

lisp/url/url-http.el

index a6963cef70136d8a059571b923695a92e5b25189..31c866bd664671de0ca130e7d0f3c46960c4fbaa 100644 (file)
@@ -551,8 +551,9 @@ work correctly."
       ;; display a file buffer even if the URL does not exist and
       ;; 'url-retrieve-synchronously' returns 404 or whatever.
       (unless (or visit
-                  (and (>= url-http-response-status 200)
-                       (< url-http-response-status 300)))
+                  (or (and (>= url-http-response-status 200)
+                           (< url-http-response-status 300))
+                      (= url-http-response-status 304))) ; "Not modified"
         (let ((desc (nth 2 (assq url-http-response-status url-http-codes))))
           (kill-buffer buffer)
           ;; Signal file-error per bug#16733.