Skip to content

Commit

Permalink
fix(standalone): fix cookie inject regex
Browse files Browse the repository at this point in the history
  • Loading branch information
redallen committed Jul 28, 2021
1 parent 59b8109 commit 64fc5eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/config-utils/cookieTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const defaultEntitlements = {

function cookieTransform(proxyReq, req, _res, { entitlements = defaultEntitlements, user, internal, identity: customIdentity }) {
const cookie = req.headers.cookie;
const match = cookie && cookie.match(/cs_jwt=([^;]+);/);
const match = cookie && cookie.match(/cs_jwt=([^;]+)/);
if (match) {
const cs_jwt = match[1];
const { payload } = jws.decode(cs_jwt);
Expand Down
6 changes: 4 additions & 2 deletions packages/config-utils/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ module.exports = ({
}

process.on('SIGINT', () => {
console.log();
serviceNames.forEach(stopService);
process.exit();
});
Expand All @@ -167,7 +166,10 @@ module.exports = ({
context: url => {
const shouldProxy = !appUrl.find(u => typeof u === 'string' ? url.startsWith(u) : u.test(url));
if (shouldProxy) {
console.log('proxy', url);
if (proxyVerbose) {
console.log('proxy', url);
}

return true;
}

Expand Down

0 comments on commit 64fc5eb

Please sign in to comment.