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:
tmahring 2020-09-11 02:27:01 +02:00 committed by GitHub
parent 308aeb187b
commit e9575bcb78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 2 deletions

View file

@ -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(