Skip to content

Commit

Permalink
fix(web: setup): allow forward slashes (non-encoded) repo names in ro…
Browse files Browse the repository at this point in the history
…utes

Resolves issue with NGINX converting encoded forward slash %2F into actual one during proxy pass
  • Loading branch information
dsevillamartin committed Nov 26, 2024
1 parent 124c0dc commit 97ea379
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/Web/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ module.exports = (app) => {
);

app.post(
'/setup/:id/connect/:type/:githubId',
'/setup/:id/connect/:type/:githubId([\\w\\.\\/]+)',
asyncHandler(async (req, res, next) => {
const { id, type, githubId } = req.params;
const { channel_id, github_token, repos } = req.setupData;
Expand Down Expand Up @@ -223,7 +223,7 @@ module.exports = (app) => {
);

app.post(
'/setup/:id/disconnect/:type/:githubId',
'/setup/:id/disconnect/:type/:githubId([\\w\\.\\/]+)',
asyncHandler(async (req, res, next) => {
const { id, type, githubId } = req.params;
const { channel_id } = req.setupData;
Expand Down Expand Up @@ -305,7 +305,7 @@ module.exports = (app) => {
);

app.post(
'/setup/:id/purge/:type/:githubId',
'/setup/:id/purge/:type/:githubId([\\w\\.\\/]+)',
limiter,
bodyParser.json(),
asyncHandler(async (req, res, next) => {
Expand Down
4 changes: 2 additions & 2 deletions views/error.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<body>
<% if (typeof stack !== 'undefined') { %>
<% if (typeof status !== 'undefined') { %>
<h1><% status %> <%= name || '' %></h1>
<h1><%= status %> <%= name || '' %></h1>
<% } %>
<pre><%= stack %></pre>
<% } else { %>
<h1><% status %> <%= name || '' %></h1>
<h1><%= status %> <%= name || '' %></h1>
<% if (message) { %>
<p><%= message %></p>
Expand Down

0 comments on commit 97ea379

Please sign in to comment.