[edge] Fixes: skip 1xx, enforce auth timeout, resolve upstreams per connect, all Upgrade tokens, strip Remote-*

This commit is contained in:
2026-11-07 15:48:18 +01:00
parent 60aee5d78a
commit a272e476b7
10 changed files with 509 additions and 115 deletions
+8 -1
View File
@@ -19,10 +19,10 @@ use std::time::Duration;
use bytes::Bytes;
use http::header::{self, HeaderName, HeaderValue};
use pingora::Result;
use pingora::connectors::http::Connector;
use pingora::http::{RequestHeader, ResponseHeader};
use pingora::proxy::Session;
use pingora::{Error, ErrorType, Result};
use crate::fetch::fetch;
use crate::runtime::ForwardAuthRt;
@@ -82,6 +82,13 @@ pub async fn check(
let got = fetch(connector, &fa.upstream, sub, MAX_AUTH_BODY, AUTH_TIMEOUT).await?;
let status = got.header.status.as_u16();
if status < 200 {
// 101 (or any 1xx left over) is not an answer we can pass on or treat as an allow.
return Error::e_explain(
ErrorType::InvalidHTTPHeader,
format!("auth server answered {status}"),
);
}
if (200..300).contains(&status) {
let copy = fa
.copy_headers