feat: introduce ServerHttpHeaderValidator replacing ServerTransportSecurityValidator
Same feature set as ServerTransportSecurityValidator but uses a lazy "header accessor" function to read header values instead of extracting all headers into a map. Matches more closely what modern frameworks and JDK APIs do. Fixes #870 Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
This commit is contained in:
parent
2bb1481ec3
commit
5be2fa0688
1 changed files with 470 additions and 168 deletions
|
|
@ -209,7 +209,7 @@ class ServerTransportSecurityIntegrationTests {
|
|||
public Sse() {
|
||||
transport = HttpServletSseServerTransportProvider.builder()
|
||||
.messageEndpoint("/mcp/message")
|
||||
.securityValidator(DefaultServerTransportSecurityValidator.builder()
|
||||
.httpHeaderValidator(DefaultServerTransportSecurityValidator.builder()
|
||||
.allowedOrigin("http://localhost:*")
|
||||
.allowedHost("localhost:*")
|
||||
.build())
|
||||
|
|
@ -242,7 +242,7 @@ class ServerTransportSecurityIntegrationTests {
|
|||
|
||||
public StreamableHttp() {
|
||||
transport = HttpServletStreamableServerTransportProvider.builder()
|
||||
.securityValidator(DefaultServerTransportSecurityValidator.builder()
|
||||
.httpHeaderValidator(DefaultServerTransportSecurityValidator.builder()
|
||||
.allowedOrigin("http://localhost:*")
|
||||
.allowedHost("localhost:*")
|
||||
.build())
|
||||
|
|
@ -276,7 +276,7 @@ class ServerTransportSecurityIntegrationTests {
|
|||
|
||||
public Stateless() {
|
||||
transport = HttpServletStatelessServerTransport.builder()
|
||||
.securityValidator(DefaultServerTransportSecurityValidator.builder()
|
||||
.httpHeaderValidator(DefaultServerTransportSecurityValidator.builder()
|
||||
.allowedOrigin("http://localhost:*")
|
||||
.allowedHost("localhost:*")
|
||||
.build())
|
||||
|
|
|
|||
Loading…
Reference in a new issue