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

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

[elpa] externals/plz f12f907719 52/81: Change/Fix: (plz--curl) Disable E


From: ELPA Syncer
Subject: [elpa] externals/plz f12f907719 52/81: Change/Fix: (plz--curl) Disable Expect header
Date: Wed, 11 May 2022 17:58:01 -0400 (EDT)

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

    Change/Fix: (plz--curl) Disable Expect header
    
    Prevents curl from implicitly sending that header for PUT requests and
    POST requests >1KB (which causes the server to send a "HTTP 100
    Continue" response, which we don't want to deal with now).
---
 plz.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/plz.el b/plz.el
index 30f4737369..c7b50b667d 100644
--- a/plz.el
+++ b/plz.el
@@ -390,6 +390,13 @@ the initial connection attempt.
 
 NOQUERY is passed to `make-process', which see."
   ;; Inspired by and copied from `elfeed-curl-retrieve'.
+
+  ;; NOTE: By default, for PUT requests and POST requests >1KB, curl sends an
+  ;; "Expect:" header, which causes servers to send a "100 Continue" response, 
which
+  ;; we don't want to have to deal with, so we disable it by setting the 
header to
+  ;; the empty string.  See <https://gms.tf/when-curl-sends-100-continue.html>.
+  ;; TODO: Handle "100 Continue" responses and remove this workaround.
+  (push (cons "Expect" "") headers)
   (let* ((header-args (cl-loop for (key . value) in headers
                                append (list "--header" (format "%s: %s" key 
value))))
          (curl-args (append plz-curl-default-args header-args



reply via email to

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