mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
don't replace plus with space in headers (#649)
* don't replace plus with space in headers * fixed forward handling with changed header parsing * add test for boundaries containing plus chars
This commit is contained in:
parent
308aeb187b
commit
e9575bcb78
2 changed files with 37 additions and 2 deletions
|
@ -2464,7 +2464,7 @@ inline bool parse_header(const char *beg, const char *end, T fn) {
|
|||
}
|
||||
|
||||
if (p < end) {
|
||||
fn(std::string(beg, key_end), decode_url(std::string(p, end), true));
|
||||
fn(std::string(beg, key_end), decode_url(std::string(p, end), false));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -4768,7 +4768,7 @@ inline bool ClientImpl::redirect(const Request &req, Response &res) {
|
|||
return false;
|
||||
}
|
||||
|
||||
auto location = res.get_header_value("location");
|
||||
auto location = detail::decode_url(res.get_header_value("location"), true);
|
||||
if (location.empty()) { return false; }
|
||||
|
||||
const static std::regex re(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue