fix(http): enforce Origin validation semantics (#1192)
Return HTTP 403 for malformed and non-UTF-8 Origin headers when validation is enabled. Add enforce_origin_validation() for strict empty-allowlist validation while preserving the legacy default and non-empty allowlist behavior. Configure the conformance server to opt in explicitly. Signed-off-by: lucarlig <luca.carlig@ibm.com>
This commit is contained in:
parent
3e636cab26
commit
e27c5d1c24
1 changed files with 117 additions and 20 deletions
|
|
@ -1744,7 +1744,9 @@ async fn main() -> anyhow::Result<()> {
|
|||
tracing::info!("Starting conformance server on {}", bind_addr);
|
||||
|
||||
let server = ConformanceServer::new();
|
||||
let config = StreamableHttpServerConfig::default();
|
||||
let config = StreamableHttpServerConfig::default()
|
||||
.with_allowed_origins([format!("http://{bind_addr}")])
|
||||
.enforce_origin_validation();
|
||||
let service = StreamableHttpService::new(
|
||||
move || Ok(server.clone()),
|
||||
LocalSessionManager::default().into(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue