Commit 80a2ee84 authored by Peter Jankuliak's avatar Peter Jankuliak
Browse files

Return bad request response when there is no route

Instead of closing the connection, as that prompted the UA to furiously
retry sending the same request many times.
parent c7a1caa1
......@@ -1865,15 +1865,17 @@ void Client::State::serve_request( GenericStream&& con
request_config = secure_first_request_route(
route_choose_config(req, matches, default_request_config));
auto meta = UserAgentMetaData::extract(req);
Transaction tnx(con, req, std::move(meta));
if (request_config.fresh_channels.empty()) {
if (log_transactions()) yield.log("Abort due to no route");
con.close();
return;
sys::error_code ec;
tnx.write_to_user_agent(retrieval_failure_response(req), cancel, yield[ec]);
if (ec || cancel) return;
continue;
}
auto meta = UserAgentMetaData::extract(req);
Transaction tnx(con, req, std::move(meta));
cache_control.mixed_fetch(tnx, yield[ec].tag("mixed_fetch"));
if (ec) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment