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
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 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 小時 新手友好度 75/100
microsoft/playwright#43327 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
microsoft/TypeScript#64758 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 65/100
opensearch-project/OpenSearch-Dashboards#12937 ·
維護者通常 2 天內回覆
-
Liveness marks block-included attesters live in the block's epoch instead of the attestation's epoch未關閉
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
status: needs-triage
難度 2/5 1-3 小時 新手友好度 83/100
a2ui-project/a2ui#3158 ·
維護者通常 2 天內回覆