inspector: fix absolute URLs in network http · nodejs/node@1718bc3 · GitHub
Skip to content

Commit 1718bc3

Browse files
GrinZeroaduh95
authored andcommitted
inspector: fix absolute URLs in network http
Some HTTP clients send an absolute URL in request.path. The network inspection code always prefixed request.protocol and host, which produced duplicated URLs such as http://hosthttp://host/path in Network.requestWillBeSent and Network.responseReceived. Handle absolute URL paths directly and keep the existing relative-path behavior unchanged. Extend the HTTP inspector test to cover both GET and POST requests that use an absolute URL as options.path and verify that getResponseBody still returns the expected payload. Signed-off-by: GrinZero <774933704@qq.com> PR-URL: #62955 Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 62fe0cf commit 1718bc3

2 files changed

Lines changed: 175 additions & 31 deletions

File tree

lib/internal/inspector/network_http.js

Lines changed: 15 additions & 1 deletion

test/parallel/test-inspector-network-http.js

Lines changed: 160 additions & 30 deletions

0 commit comments

Comments
 (0)