local-traffic 0.0.34 → 0.0.35
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/index.ts +3 -2
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -916,8 +916,9 @@ const start = () => {
|
|
|
916
916
|
|
|
917
917
|
const { key, target: targetWithForcedPrefix } = determineMapping(request);
|
|
918
918
|
const target = new URL(`${targetWithForcedPrefix.protocol}//${
|
|
919
|
-
targetWithForcedPrefix.host}${request.url.
|
|
920
|
-
|
|
919
|
+
targetWithForcedPrefix.host}${request.url.endsWith('/_next/webpack-hmr')
|
|
920
|
+
? request.url
|
|
921
|
+
: request.url.replace( new RegExp(`^${key}`, 'g'), '').replace(/^\/*/, '/')}`);
|
|
921
922
|
const downstreamRequestOptions: RequestOptions = {
|
|
922
923
|
hostname: target.hostname,
|
|
923
924
|
path: target.pathname,
|