Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
fix(proxy): add a cookieRewrite option which is passed to proxy-middl…
Browse files Browse the repository at this point in the history
…eware. (#1226)

This allows cookies to be forwarded correctly when using a proxy
to an HTTPS URL.

Related:
* #454
* ionic-team/ionic-cli#415
  • Loading branch information
Airblader authored and danbucholtz committed Oct 12, 2017
1 parent 93db0ef commit 771ee63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/dev-server/http-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function setupProxies(app: express.Application) {
}

opts.rejectUnauthorized = !(proxy.rejectUnauthorized === false);
opts.cookieRewrite = proxy.cookieRewrite;

app.use(proxy.path, proxyMiddleware(opts));
Logger.info('Proxy added:' + proxy.path + ' => ' + url.format(opts));
Expand Down
3 changes: 2 additions & 1 deletion src/util/ionic-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export interface IonicProject {
path: string,
proxyUrl: string,
proxyNoAgent: boolean,
rejectUnauthorized: boolean
rejectUnauthorized: boolean,
cookieRewrite: string | boolean,
}[];
}

Expand Down

0 comments on commit 771ee63

Please sign in to comment.