Skip to content

Commit b06f4e5

Browse files
author
alexni
committed
feat(fetch() network interceptor helpers): url detection improvement
1 parent 3d45c86 commit b06f4e5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Network/helpers/setupXHRInterceptor.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,13 @@ function hookFetch({
193193
try {
194194
const requestId = getRequestId();
195195
const method = ((init ? init.method : null) || 'GET').toUpperCase();
196-
const url = (typeof input === 'string' ? input : '').toLowerCase();
196+
let url = '';
197+
if (typeof input === 'string') {
198+
url = input;
199+
} else if (input instanceof Request) {
200+
url = input.url;
201+
}
202+
url = url.toLowerCase();
197203
const body = init ? init.body : null;
198204

199205
onRequestSeen({

0 commit comments

Comments
 (0)