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

Fix proxy auth issue #519 #520

Merged
merged 1 commit into from
Oct 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/templates/node-server/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ if (options.mlCertificate) {
/************************************************/

// TODO: configurable path?
var target = url.format({
var target = {
protocol: options.mlCertificate ? 'https' : 'http',
hostname: options.mlHost,
port: options.mlHttpPort,
pathname: '/v1'
});
};

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

return authHelper.getAuthorization(req.session, req.method, req.path, {
return authHelper.getAuthorization(req.session, req.method, target.pathname + req.path, {
authUser: user
});
}
Expand Down