mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-06 18:18:52 +08:00
nghttpx: Fix assertion error because of empty scheme
This commit is contained in:
@@ -198,6 +198,10 @@ void rewrite_request_host_path_from_uri(Downstream *downstream, const char *uri,
|
|||||||
}
|
}
|
||||||
downstream->set_request_http2_authority(authority);
|
downstream->set_request_http2_authority(authority);
|
||||||
|
|
||||||
|
std::string scheme;
|
||||||
|
http2::copy_url_component(scheme, &u, UF_SCHEMA, uri);
|
||||||
|
downstream->set_request_http2_scheme(std::move(scheme));
|
||||||
|
|
||||||
std::string path;
|
std::string path;
|
||||||
if (u.field_set & (1 << UF_PATH)) {
|
if (u.field_set & (1 << UF_PATH)) {
|
||||||
http2::copy_url_component(path, &u, UF_PATH, uri);
|
http2::copy_url_component(path, &u, UF_PATH, uri);
|
||||||
@@ -225,10 +229,6 @@ void rewrite_request_host_path_from_uri(Downstream *downstream, const char *uri,
|
|||||||
downstream->set_request_path(
|
downstream->set_request_path(
|
||||||
http2::rewrite_clean_path(std::begin(path), std::end(path)));
|
http2::rewrite_clean_path(std::begin(path), std::end(path)));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string scheme;
|
|
||||||
http2::copy_url_component(scheme, &u, UF_SCHEMA, uri);
|
|
||||||
downstream->set_request_http2_scheme(std::move(scheme));
|
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user