JavaWebStack / JavaWebStack/web-utils

Extend CORSPolicy to allow for custom headers

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Java
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
By default CORS blocks access to all headers except `content-type`. Custom headers need to be exposed using the header `Access-Control-Expose-Headers`.

**Describe the solution you'd like**
The CORSPolicy class should have a chainable method called `exposeHeader` which will take the header/pattern to be further used by building a comma seperated header value for `Access-Control-Expose-Headers` according to the spec.

**Describe alternatives you've considered**
I've implemented a simple RequestInterceptor which sets this header manually.

**Additional context**
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the CORSPolicy class and review how it currently builds CORS response headers. Use the linked CORS specification guidance to define the expected comma-separated Access-Control-Expose-Headers value; done means a chainable exposeHeader method accepts a header or pattern and produces that header correctly.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.