Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

ability to rewrite location and cookies on v1-toolkit proxies

オープン
#4,770 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
cli

調査の方向性

ionic.config.json のプロキシ設定から始め、リンクされている v1-toolkit-proxy-rewrite-location-and-cookie fork を確認します。CLI が http-proxy-middleware をどのように使用しているかを確認し、Cookie ドメインの書き換え、Location の書き換え、デバッグ、動的なパスベースのプロキシターゲットをまとめてスコープ化できるか判断します。選択したプロキシ動作について、合意された機能範囲と承認済みの実装があれば完了です。

索引モデルが issue の本文から書いたものです。

説明

triage

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:

  1. one of our api does some redirection (like http://testserver 302-redirects to http://testserver/otherapi)
  2. 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)
  3. 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 headers
  • locationRewrite: boolean turns on rewriting location host+port AND path on redirection. For example if you proxy /api to http://testserver then a header Location: http://testserver/otherapi would be rewritten to Location: http://localhost:8100/api/otherapi.
  • debug: boolean turns on verbose debugging of http-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 はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ionic-team/ionic-cli のほかの issue

ionic-team/ionic-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。