Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 209e7e3

Browse filesBrowse files
aidantdanielleadams
authored andcommitted
http: add debug log for ERR_UNESCAPED_CHARACTERS
When encountering ERR_UNESCAPED_CHARACTERS on large applications it can be unclear which request has caused this error. Even when setting NODE_DEBUG=http there is no information about this error since it's thrown before any debug logs. This patch adds a debug log that contains the invalid path. PR-URL: #45420 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent f2a4def commit 209e7e3
Copy full SHA for 209e7e3

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎lib/_http_client.js‎

Copy file name to clipboardExpand all lines: lib/_http_client.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ function ClientRequest(input, options, cb) {
178178

179179
if (options.path) {
180180
const path = String(options.path);
181-
if (RegExpPrototypeExec(INVALID_PATH_REGEX, path) !== null)
181+
if (RegExpPrototypeExec(INVALID_PATH_REGEX, path) !== null) {
182+
debug('Path contains unescaped characters: "%s"', path);
182183
throw new ERR_UNESCAPED_CHARACTERS('Request path');
184+
}
183185
}
184186

185187
if (protocol !== expectedProtocol) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.