[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/plz-see f82b7530bb 02/10: Handle missing content-type a
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/plz-see f82b7530bb 02/10: Handle missing content-type and content-length correctly |
|
Date: |
Wed, 1 Nov 2023 18:58:45 -0400 (EDT) |
branch: externals/plz-see
commit f82b7530bb224bd20c152432a03757ad46e7dd4a
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>
Handle missing content-type and content-length correctly
---
plzi.el | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/plzi.el b/plzi.el
index 818a61ccc7..0629b25ac6 100644
--- a/plzi.el
+++ b/plzi.el
@@ -116,20 +116,20 @@ The car is the number of buffers created so far.")
(defvar plzi-header-line-content-type
'(:eval
(setq-local plzi-header-line-content-type
- (format " | %s"
- (alist-get 'content-type
- (plz-response-headers plzi-response))))))
+ (when-let ((ct (alist-get 'content-type
+ (plz-response-headers
plzi-response))))
+ (format " | %s" ct)))))
(defvar plzi-header-line-content-length
'(:eval
(setq-local plzi-header-line-content-length
- (format " | %s bytes"
- (alist-get 'content-length
- (plz-response-headers plzi-response))))))
+ (when-let ((len (alist-get 'content-length
+ (plz-response-headers
plzi-response))))
+ (format " | %s bytes" len)))))
(defvar plzi-header-line-show-headers
'(:eval
- (setq-local plzi-header-line-show
+ (setq-local plzi-header-line-show-headers
(format " | %s"
(buttonize "show headers"
(lambda (buffer)
@@ -145,9 +145,9 @@ The car is the number of buffers created so far.")
(error (and (plz-error-p response) response))
(response (if error (plz-error-response error) response))
(headers (plz-response-headers response))
- (mode (alist-get (alist-get 'content-type headers)
- plzi-content-type-alist
- nil nil #'string-match-p))
+ (mode (when-let ((ct (alist-get 'content-type headers)))
+ (alist-get ct plzi-content-type-alist
+ nil nil #'string-match-p)))
(body (plz-response-body response)))
(with-current-buffer buffer
(save-excursion
- [elpa] branch externals/plz-see created (now c55e6aa297), ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see bdcc265ce9 01/10: Initial commit, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see 0dc77f9f69 04/10: Add readme and docstrings, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see f0198fd494 05/10: Add screenshot, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see 08ab7e7923 08/10: Expand docstring, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see f82b7530bb 02/10: Handle missing content-type and content-length correctly,
ELPA Syncer <=
- [elpa] externals/plz-see 4d788655b6 03/10: Rename package, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see c55e6aa297 10/10: Version 0.1, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see 9b45fb544f 06/10: Address comments from emacs-devel, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see 939c39fbf2 07/10: Add completion predicate for command, ELPA Syncer, 2023/11/01
- [elpa] externals/plz-see e144d38654 09/10: Don't make base URL and headers variables buffer-local by default, ELPA Syncer, 2023/11/01