Fix Nginx double slash issue in proxy server

This commit is contained in:
2025-12-27 19:01:53 +11:00
parent 7560b9daad
commit 2774bf509f

View File

@@ -68,7 +68,8 @@ const server = http.createServer((req, res) => {
} }
// Handle Git Info request // Handle Git Info request
if (req.url === '/git-info' && req.method === 'GET') { // Nginx proxy_pass might result in double slashes (//git-info)
if ((req.url === '/git-info' || req.url === '//git-info') && req.method === 'GET') {
handleCORS(res); handleCORS(res);
getGitInfo().then(info => { getGitInfo().then(info => {
res.writeHead(200, { 'Content-Type': 'application/json' }); res.writeHead(200, { 'Content-Type': 'application/json' });