JavaWebStack / JavaWebStack/web-utils
Extend CORSPolicy to allow for custom headers
還沒有人認領這個 Issue。
- 主要語言
- Java
- 星號
- 1
- 分支
- 0
- PR 合併指標
- 30 天內沒有已合併 PR
描述
**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
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
定位 CORSPolicy 類別,並檢視它目前如何建構 CORS 回應標頭。使用連結的 CORS 規範指引來定義預期的逗號分隔 Access-Control-Expose-Headers 值;完成的定義是可鏈式呼叫的 exposeHeader 方法接受標頭或模式,並正確產生該標頭。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- java
- 領域
- api, backend
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 50/100