Skip to content

Commit

Permalink
apply the fix for support colons
Browse files Browse the repository at this point in the history
  • Loading branch information
nkzawa committed Mar 22, 2022
1 parent 1988669 commit 758a371
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/next/server/next-server.ts
Expand Up @@ -49,7 +49,7 @@ import { getExtension, serveStatic } from './serve-static'
import { ParsedUrlQuery } from 'querystring'
import { apiResolver } from './api-utils/node'
import { RenderOpts, renderToHTML } from './render'
import { ParsedUrl } from '../shared/lib/router/utils/parse-url'
import { ParsedUrl, parseUrl } from '../shared/lib/router/utils/parse-url'
import * as Log from '../build/output/log'

import BaseServer, {
Expand Down Expand Up @@ -1190,12 +1190,8 @@ export default class NextNodeServer extends BaseServer {

if (result.response.headers.has('x-middleware-rewrite')) {
const rewritePath = result.response.headers.get('x-middleware-rewrite')!
const { newUrl, parsedDestination } = prepareDestination({
appendParamsToQuery: false,
destination: rewritePath,
params: {},
query: {},
})
const parsedDestination = parseUrl(rewritePath)
const newUrl = parsedDestination.pathname

// TODO: remove after next minor version current `v12.0.9`
this.warnIfQueryParametersWereDeleted(
Expand Down

0 comments on commit 758a371

Please sign in to comment.