This commit is contained in:
1 parent
608164dfdd
commit
a4b85162ab
6 files changed
+127
-19
No files matched your search
@@ -6,7 +6,7 @@ const {
|
||||
probeCycle,
|
||||
startProbing,
|
||||
stopProbing,
|
||||
} = require('./src/upstreams');
|
||||
} = require('./src/upstream-pool');
|
||||
const { handleProxy } = require('./src/proxy');
|
||||
const { healthPayload } = require('./src/health');
|
||||
const { sendText, sendJson } = require('./src/http-utils');
|
||||
@@ -16,7 +16,8 @@ const HEALTH_PATHS = new Set(['/health', '/healthz']);
|
||||
const server = http.createServer((req, res) => {
|
||||
let reqUrl;
|
||||
try {
|
||||
reqUrl = new URL(req.url, 'http://proxy.invalid');
|
||||
const rawUrl = req.url.replace(/^\/+/, '/');
|
||||
reqUrl = new URL(rawUrl, 'http://proxy.invalid');
|
||||
} catch {
|
||||
sendText(res, 400, 'Bad request');
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user