undici 7.24.3 → 7.24.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/web/fetch/index.js +4 -1
- package/package.json +1 -1
package/lib/web/fetch/index.js
CHANGED
|
@@ -2132,9 +2132,12 @@ async function httpNetworkFetch (
|
|
|
2132
2132
|
/** @type {import('../../..').Agent} */
|
|
2133
2133
|
const agent = fetchParams.controller.dispatcher
|
|
2134
2134
|
|
|
2135
|
+
const path = url.pathname + url.search
|
|
2136
|
+
const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === '?'
|
|
2137
|
+
|
|
2135
2138
|
return new Promise((resolve, reject) => agent.dispatch(
|
|
2136
2139
|
{
|
|
2137
|
-
path:
|
|
2140
|
+
path: hasTrailingQuestionMark ? `${path}?` : path,
|
|
2138
2141
|
origin: url.origin,
|
|
2139
2142
|
method: request.method,
|
|
2140
2143
|
body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
|