emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/plz b063f950f0 2/5: Change/Fix: (plz-http-response-stat


From: ELPA Syncer
Subject: [elpa] externals/plz b063f950f0 2/5: Change/Fix: (plz-http-response-status-line-regexp) For HTTP 1 and 2
Date: Sat, 31 Dec 2022 16:58:01 -0500 (EST)

branch: externals/plz
commit b063f950f03637b2d8efb6a1ad7808c1d46ad944
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Change/Fix: (plz-http-response-status-line-regexp) For HTTP 1 and 2
    
    Inexplicably, using the `rx' forms `blank' and `space' worked on my
    local machine but not on the GitHub CI; replacing the use of them with
    plain space characters seems to fix the problem.  (My best guess is
    that it's something to do with how the Nix Emacs build is configured,
    Unicode settings, locale, or something like that.)
    
    This now appears to work for both HTTP/1.1 and HTTP/2.  If possible,
    I'll extend the test suite to explicitly test both (but I already
    tried that and had weird errors from libcurl, so we'll see).
---
 plz.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/plz.el b/plz.el
index 6d354c70f9..d2866ff34f 100644
--- a/plz.el
+++ b/plz.el
@@ -110,12 +110,16 @@
 ;;;; Constants
 
 (defconst plz-http-response-status-line-regexp
-  (rx bol "HTTP/" (group (1+ (or digit ".")))
+  (rx "HTTP/" (group (or "1.0" "1.1" "2")) " "
       ;; Status code
-      (1+ blank) (group (1+ digit))
+      (group (1+ digit)) " "
       ;; Reason phrase
-      (optional (1+ blank) (group (1+ (not (any "\r\n")))))
-      "\r\n")
+      (optional (group (1+ (not (any "\r\n")))))
+      (or
+       ;; HTTP 1
+       "\r\n"
+       ;; HTTP 2
+       "\n"))
   "Regular expression matching HTTP response status line.")
 
 (defconst plz-http-end-of-headers-regexp



reply via email to

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