]> granicus.if.org Git - curl/commit
tool_cb_hdr: Fix --remote-header-name with schemeless URL
authorJay Satiro <raysatiro@yahoo.com>
Sun, 1 May 2016 20:07:04 +0000 (16:07 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Sun, 1 May 2016 20:07:04 +0000 (16:07 -0400)
commitb9728bca549709a26a5228f1d44f7488dd26811d
tree1bbc3d0aa4872f05299c22de7d3d319270384f2b
parent283babfaf8d8f3bab9d3c63cea94eb0b84e79c37
tool_cb_hdr: Fix --remote-header-name with schemeless URL

- Move the existing scheme check from tool_operate.

In the case of --remote-header-name we want to parse Content-disposition
for a filename, but only if the scheme is http or https. A recent
adjustment 0dc4d8e was made to account for schemeless URLs however it's
not 100% accurate. To remedy that I've moved the scheme check to the
header callback, since at that point the library has already determined
the scheme.

Bug: https://github.com/curl/curl/issues/760
Reported-by: Kai Noda
src/tool_cb_hdr.c
src/tool_operate.c