Skip to content

Add test coverage for incomplete CORS preflight requests#4173

Open
njp2k5 wants to merge 1 commit into
spring-cloud:mainfrom
njp2k5:cors-edge-cases
Open

Add test coverage for incomplete CORS preflight requests#4173
njp2k5 wants to merge 1 commit into
spring-cloud:mainfrom
njp2k5:cors-edge-cases

Conversation

@njp2k5
Copy link
Copy Markdown

@njp2k5 njp2k5 commented May 16, 2026

Adds test coverage for OPTIONS requests missing the
Access-Control-Request-Method header.

This verifies current global CORS handling for incomplete preflight requests
and helps prevent regressions in request validation behavior.

tested with ./mvnw test -pl spring-cloud-gateway-server-webflux -Dtest=CorsGlobalTests

Signed-off-by: njp2k5 <nikhiljp05@gmail.com>
Copilot AI review requested due to automatic review settings May 16, 2026 13:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a test case verifying that OPTIONS requests missing the Access-Control-Request-Method header (incomplete CORS preflight) return HTTP 403 Forbidden under the existing global CORS configuration.

Changes:

  • New test method testPreFlightCorsRequestWithoutAccessControlRequestMethod in CorsGlobalTests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants