File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1- import url from 'url '
2- import path from 'path'
1+ import path from 'node:path '
2+
33import type express from 'express'
44import type next from 'next'
5- import type { KeystoneContext , KeystoneConfig } from '../types'
65import { pkgDir } from '../pkg-dir'
6+ import type { KeystoneConfig , KeystoneContext } from '../types'
77
88const adminErrorHTMLFilepath = path . join ( pkgDir , 'static' , 'admin-error.html' )
99
@@ -21,7 +21,7 @@ export function createAdminUIMiddlewareWithNextApp(
2121 if ( basePath . endsWith ( '/' ) ) throw new TypeError ( 'basePath must not end with a trailing slash' )
2222
2323 return async ( req : express . Request , res : express . Response ) => {
24- const { pathname } = url . parse ( req . url )
24+ const { pathname } = new URL ( req . url , 'http://ks' )
2525
2626 if ( pathname ?. startsWith ( `${ basePath } /_next` ) || pathname ?. startsWith ( `${ basePath } /__next` ) ) {
2727 return handle ( req , res )
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import fsp from 'node:fs/promises'
22import { createServer } from 'node:http'
33import type { ListenOptions } from 'node:net'
44import path from 'node:path'
5- import url from 'node:url'
65
76import { createDatabase } from '@prisma/internals'
87import chalk from 'chalk'
@@ -393,7 +392,7 @@ export async function dev(
393392 return expressServer ( req , res , next )
394393 }
395394
396- const { pathname } = url . parse ( req . url )
395+ const { pathname } = new URL ( req . url , 'http://ks' )
397396 if ( expressServer && pathname === ( config . graphql ?. path ?? '/api/graphql' ) ) {
398397 return expressServer ( req , res , next )
399398 }
You can’t perform that action at this time.
0 commit comments