v0.34.0_1
This commit is contained in:
1 parent
9b3d6731cc
commit
00f29f92c8
68 files changed
+2599
-513
No files matched your search
@@ -107,7 +107,14 @@ async fn forward_request(
|
||||
"RustProxy: ambiguous request path\n",
|
||||
);
|
||||
};
|
||||
let frontend = snapshot.frontend(&host, local.0, tls);
|
||||
let selected_context = request.extensions().get::<SelectedRouteContext>().cloned();
|
||||
let frontend = if let Some(selection) = &selected_context {
|
||||
selection.frontend.as_ref()
|
||||
} else {
|
||||
// Internal error fallback calls forward_request directly, without
|
||||
// rerunning the observation middleware.
|
||||
snapshot.frontend(&host, local.0, tls)
|
||||
};
|
||||
if snapshot.user_agent_blocking.blocks(request.headers())
|
||||
|| frontend.is_some_and(|frontend| frontend.user_agent_blocking.blocks(request.headers()))
|
||||
{
|
||||
@@ -307,6 +314,8 @@ async fn forward_request(
|
||||
} else {
|
||||
snapshot.select_internal_on(&host, &dispatch.vhost_id, &dispatch.target, local.0, tls)
|
||||
}
|
||||
} else if let Some(selection) = &selected_context {
|
||||
selection.route.as_deref()
|
||||
} else {
|
||||
snapshot.select_on(&host, &path, local.0, tls)
|
||||
};
|
||||
@@ -343,7 +352,11 @@ async fn forward_request(
|
||||
);
|
||||
}
|
||||
}
|
||||
let fallback_request = ErrorFallbackRequest::capture(&request, &snapshot);
|
||||
// Normal routes almost never have an internal error fallback. Do not copy
|
||||
// the complete HeaderMap and request metadata when no fallback exists.
|
||||
let fallback_request = selected
|
||||
.filter(|route| route.error_fallback.is_some())
|
||||
.map(|_| ErrorFallbackRequest::capture(&request, &snapshot));
|
||||
// The admin cookie is never ordinary application state. Strip it BEFORE
|
||||
// auth/cache and keep only the removed fragment locally. A verified self-admin
|
||||
// backend may restore it after the actual upstream has been selected.
|
||||
|
||||
Reference in new issue
Block a user