Merge branch '6.3.x' into 6.4.x
Closes gh-17032
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -534,4 +534,17 @@ class StrictServerWebExchangeFirewallTests {
|
||||
.isThrownBy(() -> headers.get(invalidHeaderName));
|
||||
}
|
||||
|
||||
// gh-16978
|
||||
@Test
|
||||
void getMutatedFirewalledExchangeHeadersGetHeaderWhenNotAllowedHeaderNameThenException() {
|
||||
String invalidHeaderName = "bad name";
|
||||
this.firewall.setAllowedHeaderNames((name) -> !name.equals(invalidHeaderName));
|
||||
ServerWebExchange exchange = getFirewalledExchange();
|
||||
var mutatedRequest = exchange.getRequest().mutate().method(HttpMethod.POST).build();
|
||||
var mutatedExchange = exchange.mutate().request(mutatedRequest).build();
|
||||
HttpHeaders headers = mutatedExchange.getRequest().getHeaders();
|
||||
assertThatExceptionOfType(ServerExchangeRejectedException.class)
|
||||
.isThrownBy(() -> headers.get(invalidHeaderName));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user