Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

ability to rewrite location and cookies on v1-toolkit proxies

Offen
#4,770 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
typescript
Bereich
cli

Rechercherichtung

Beginne mit der Proxy-Konfiguration in ionic.config.json und überprüfe den verknüpften v1-toolkit-proxy-rewrite-location-and-cookie-Fork. Prüfe, wie die CLI http-proxy-middleware verwendet, und ermittle, ob Cookie-Domain-Umschreibung, Location-Umschreibung, Debugging und dynamische pfadbasierte Proxy-Ziele gemeinsam eingeschränkt werden können. Als abgeschlossen gilt die Aufgabe, wenn ein abgestimmter Funktionsumfang und eine akzeptierte Implementierung für die ausgewählten Proxy-Verhaltensweisen vorliegen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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/"
}
Vorherrschende Sprache
TypeScript
Sterne
2k
Forks
681
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ionic-team/ionic-cli

Alle Issues in ionic-team/ionic-cli

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.