jetty / jetty/jetty.project

CrossOriginHandler not returning valid headers when all headers are allowed

Open
#15,096 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
Java
Stars
4.1k
Forks
2k
Avg merge
3d 56m
Merged PRs (30d)
48

Description

**Jetty version(s)**
jetty 12.1.8

**Jetty Environment**
ee8

**HTTP version**
HTTP 1.1

**Java version/vendor** `(use: java -version)`
penjdk version "17.0.18" 2026-01-20 LTS
OpenJDK Runtime Environment Corretto-17.0.18.9.1 (build 17.0.18+9-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.18.9.1 (build 17.0.18+9-LTS, mixed mode, sharing)

**OS type/version**
docker container jetty:12.1.8-jdk17-eclipse-temurin

**Description**
if you configure the CrossOriginHandler with allowed headers `"*"` and credentials enabled, it will incorrectly return the header `"Access-Control-Allow-Headers: *"` for a preflight response. According to the spec,` "*"` is an invalid response for a cors preflight request with credentials enabled. the deprecated CrossOriginFilter correctly reflects the requested headers in the response in this situation.

**How to reproduce?**
configure the CrossOriginHandler with allowed headers `"*"` and credentials enabled and make a preflight request with requested headers.

Contributor guide

Open the contributing guide

Research direction

Start at CrossOriginHandler and reproduce a CORS preflight with allowed headers set to "*", credentials enabled, and requested headers present. Compare the response with the CORS specification and the deprecated CrossOriginFilter behavior; done means the preflight returns valid headers instead of Access-Control-Allow-Headers: * in this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.