update nuxt
This commit is contained in:
parent
c08ee8f441
commit
08afdc600c
|
|
@ -790,12 +790,11 @@ export default defineNitroPlugin(() => {
|
||||||
const proxiedDispatcher = getGlobalDispatcher().compose(dispatch => (opts, handler) => {
|
const proxiedDispatcher = getGlobalDispatcher().compose(dispatch => (opts, handler) => {
|
||||||
const isInternal = opts.path.startsWith("/__nuxt")
|
const isInternal = opts.path.startsWith("/__nuxt")
|
||||||
const proxy = getRequestHeader(useEvent(), 'x-playwright-proxy')
|
const proxy = getRequestHeader(useEvent(), 'x-playwright-proxy')
|
||||||
if (!proxy || isInternal)
|
if (proxy && !isInternal) {
|
||||||
return dispatch(opts, handler)
|
const newURL = new URL(decodeURIComponent(proxy) + opts.origin + opts.path);
|
||||||
|
opts.origin = newURL.origin;
|
||||||
const newURL = new URL(decodeURIComponent(proxy) + opts.origin + opts.path);
|
opts.path = newURL.pathname;
|
||||||
opts.origin = newURL.origin;
|
}
|
||||||
opts.path = newURL.pathname;
|
|
||||||
return dispatch(opts, handler)
|
return dispatch(opts, handler)
|
||||||
})
|
})
|
||||||
setGlobalDispatcher(proxiedDispatcher)
|
setGlobalDispatcher(proxiedDispatcher)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue