From 08afdc600ce8557346044156e6cd12ce4fa8ccbd Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Mon, 3 Feb 2025 09:21:40 +0100 Subject: [PATCH] update nuxt --- docs/src/mock.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/src/mock.md b/docs/src/mock.md index 177655adc6..9ef77526b9 100644 --- a/docs/src/mock.md +++ b/docs/src/mock.md @@ -790,12 +790,11 @@ export default defineNitroPlugin(() => { const proxiedDispatcher = getGlobalDispatcher().compose(dispatch => (opts, handler) => { const isInternal = opts.path.startsWith("/__nuxt") const proxy = getRequestHeader(useEvent(), 'x-playwright-proxy') - if (!proxy || isInternal) - return dispatch(opts, handler) - - const newURL = new URL(decodeURIComponent(proxy) + opts.origin + opts.path); - opts.origin = newURL.origin; - opts.path = newURL.pathname; + if (proxy && !isInternal) { + const newURL = new URL(decodeURIComponent(proxy) + opts.origin + opts.path); + opts.origin = newURL.origin; + opts.path = newURL.pathname; + } return dispatch(opts, handler) }) setGlobalDispatcher(proxiedDispatcher)