summaryrefslogtreecommitdiff
path: root/src/tool_cb_hdr.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-07-31 00:27:50 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-07-31 11:12:57 +0200
commite78f2cfe56c39a6c32191c207aae683de0e9a042 (patch)
tree40c53ae0c8a5a33ee1bbd2d36f84ebc6c65b5211 /src/tool_cb_hdr.c
parentd6cf93011d8f9962c763cab4e8aa975567f6ea69 (diff)
downloadcurl-e78f2cfe56c39a6c32191c207aae683de0e9a042.tar.gz
curl: use Content-Disposition before the "URL end" for -OJ
Regression introduced in 7.61.0 Reported-by: Thomas Klausner Fixes #2783 Closes #2813
Diffstat (limited to 'src/tool_cb_hdr.c')
-rw-r--r--src/tool_cb_hdr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c
index 6419b7204..04bc7e17b 100644
--- a/src/tool_cb_hdr.c
+++ b/src/tool_cb_hdr.c
@@ -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 &&