]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl: use Content-Disposition before the "URL end" for -OJ
authorDaniel Stenberg <daniel@haxx.se>
Mon, 30 Jul 2018 22:27:50 +0000 (00:27 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 31 Jul 2018 09:12:57 +0000 (11:12 +0200)
Regression introduced in 7.61.0

Reported-by: Thomas Klausner
Fixes #2783
Closes #2813

src/tool_cb_hdr.c

index 6419b72048a7fb673b60a9f6054c01800904ffc7..04bc7e17bb83eb515bd1f70b223945dbcb8bc7bf 100644 (file)
@@ -106,9 +106,6 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
      (protocol & (CURLPROTO_HTTPS|CURLPROTO_HTTP))) {
     const char *p = str + 20;
 
-    if(!outs->stream && !tool_create_output_file(outs, FALSE))
-      return failure;
-
     /* look for the 'filename=' parameter
        (encoded filenames (*=) are not supported) */
     for(;;) {
@@ -156,6 +153,8 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
       }
       break;
     }
+    if(!outs->stream && !tool_create_output_file(outs, FALSE))
+      return failure;
   }
 
   if(hdrcbdata->config->show_headers &&