ability to rewrite location and cookies on v1-toolkit proxies
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
- 领域
- cli
调研方向
从 ionic.config.json 中的代理配置开始,并查看关联的 v1-toolkit-proxy-rewrite-location-and-cookie fork。检查 CLI 如何使用 http-proxy-middleware,并确定 cookie-domain 重写、Location 重写、调试和基于路径的动态代理目标是否可以统一限定范围。对于选定的代理行为,达成一致的功能范围并接受相应的实现后,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Our app runs ionic v1 and until now we used Chrome with some security settings turned off when testing our app in order to avoid most cross-origin issues like CORS and cookie samesite over HTTP when we call our REST API.
Recently Chrome 94 dropped support of some flags we really need like SameSiteByDefaultCookies or CookiesWithoutSameSiteMustBeSecure.
So we decided to use ionic's proxies feature which is configurable in ionic.config.json.
Unfortunately we went through some impediments:
- one of our api does some redirection (like
http://testserver302-redirects tohttp://testserver/otherapi) - on production servers, some cookies have a domain set, which of course won't match the local test server entry point (usually http://localhost:8100)
- we have a lot of different test servers, this would require a lot of entries in the proxies array.
To cover cases 1) and 2), we implemented new settings for the proxy (development has started on a fork):
cookieDomainRewrite: { [domain: string]: string };turns on rewriting cookie domain on set-cookie headerslocationRewrite: booleanturns on rewriting location host+port AND path on redirection. For example if you proxy/apitohttp://testserverthen a headerLocation: http://testserver/otherapiwould be rewritten toLocation: http://localhost:8100/api/otherapi.debug: booleanturns on verbose debugging ofhttp-proxy-middleware
I know v1 is quite old, but could these features be of interest for other users and so we might open a pull request ? Or maybe you have some suggestions ?
For case 3) we are willing to implement dynamic proxy based on path. The idea is to redirect on a different server based on a part of the path. Something that would be configurable this way:
{
"path": "/api/*",
"proxyUrl": "http://$1/"
}
- 主要语言
- TypeScript
- 星标
- 2k
- 派生
- 681
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ionic-team/ionic-cli 的其他 Issue
-
triage
难度 1/5 1 小时以内 新手友好度 65/100
ionic-team/ionic-cli#5016 ·
-
triage
难度 5/5 一周以上 新手友好度 15/100
ionic-team/ionic-cli#5131 ·
-
triage
难度 3/5 1-2 天 新手友好度 56/100
ionic-team/ionic-cli#5130 ·
-
triage
难度 3/5 1-2 天 新手友好度 72/100
ionic-team/ionic-cli#5129 ·
-
triage
难度 3/5 1-2 天 新手友好度 42/100
ionic-team/ionic-cli#5127 · 2 条评论 ·
查看 ionic-team/ionic-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
bug v2
难度 2/5 1-3 小时 新手友好度 75/100
modelcontextprotocol/inspector#2458 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
难度 2/5 1-3 小时 新手友好度 70/100
carbon-design-system/ibm-products#9907 ·