Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.

Commit 254e336

Browse files
authored
Merge pull request #520 from ryanjdew/bug/519-proxy-auth-issue
Fix proxy auth issue #519
2 parents f7fa9fd + 5b494d2 commit 254e336

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/templates/node-server/proxy.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ if (options.mlCertificate) {
2323
/************************************************/
2424

2525
// TODO: configurable path?
26-
var target = url.format({
26+
var target = {
2727
protocol: options.mlCertificate ? 'https' : 'http',
2828
hostname: options.mlHost,
2929
port: options.mlHttpPort,
3030
pathname: '/v1'
31-
});
31+
};
3232

3333
var proxyServer = httpProxy.createProxyServer({
34-
target: target,
34+
target: url.format(target),
3535
ca: options.mlCertificate ? ca : null,
3636
secure: options.httpsStrict
3737
//options.httpsStrict === false assumes that you are in dev mode
@@ -41,7 +41,7 @@ function getAuth(req) {
4141
var user = req.session.passport && req.session.passport.user &&
4242
req.session.passport.user.username;
4343

44-
return authHelper.getAuthorization(req.session, req.method, req.path, {
44+
return authHelper.getAuthorization(req.session, req.method, target.pathname + req.path, {
4545
authUser: user
4646
});
4747
}

0 commit comments

Comments
 (0)