We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7390231 commit 123b4bfCopy full SHA for 123b4bf
index.ts
@@ -285,7 +285,19 @@ if (useHttp) {
285
return
286
}
287
288
- const url = new URL(req.url!, `http://localhost:${port}`)
+ let url: URL
289
+ try {
290
+ url = new URL(req.url!, `http://localhost:${port}`)
291
+ } catch (error) {
292
+ logger.warn(`Invalid URL in request: ${req.url} - ${error}`)
293
+ res.writeHead(400, { 'Content-Type': 'application/json' })
294
+ res.end(JSON.stringify({
295
+ jsonrpc: '2.0',
296
+ error: { code: -32000, message: 'Bad Request: Invalid URL' },
297
+ id: null
298
+ }))
299
+ return
300
+ }
301
302
// Health check endpoint for K8s/Docker
303
if (url.pathname === '/health') {
0 commit comments