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.
@@ -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: url.href.slice(url.href.indexOf(url.host) + url.host.length, url.hash.length ? -url.hash.length : undefined),
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "7.24.3",
3
+ "version": "7.24.4",
4
4
  "description": "An HTTP/1.1 client, written from scratch for Node.js",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {