JavaWebStack / JavaWebStack/web-utils

Extend CORSPolicy to allow for custom headers

未关闭
#5 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement good first 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

贡献指南

这个仓库没有索引到贡献指南

调研方向

定位 CORSPolicy 类,并审查它当前如何构建 CORS 响应标头。使用链接的 CORS 规范指导来定义预期的逗号分隔的 Access-Control-Expose-Headers 值;完成标准是可链式调用的 exposeHeader 方法接受一个标头或模式,并正确生成该标头。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
api, backend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
50/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。