Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Feb 18, 2022
1 parent fa83f73 commit de0b5a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/next/server/next-server.ts
Expand Up @@ -73,6 +73,7 @@ import { loadEnvConfig } from '@next/env'
import { getCustomRoute } from './server-route-utils'
import { urlQueryToSearchParams } from '../shared/lib/router/utils/querystring'
import ResponseCache from '../server/response-cache'
import { removePathTrailingSlash } from '../client/normalize-trailing-slash'

export * from './base-server'

Expand Down Expand Up @@ -1029,7 +1030,8 @@ export default class NextNodeServer extends BaseServer {
},
})

if (!this.middleware?.some((m) => m.match(parsedUrl.pathname))) {
const normalizedPathname = removePathTrailingSlash(parsedUrl.pathname)
if (!this.middleware?.some((m) => m.match(normalizedPathname))) {
return { finished: false }
}

Expand Down
2 changes: 0 additions & 2 deletions packages/next/shared/lib/router/utils/parse-next-url.ts
Expand Up @@ -5,7 +5,6 @@ import type { NextConfig, DomainLocale } from '../../../../server/config-shared'
import type { ParsedUrl } from './parse-url'
import type { PathLocale } from '../../i18n/normalize-locale-path'
import { hasBasePath, replaceBasePath } from '../../../../server/router'
import { removePathTrailingSlash } from '../../../../client/normalize-trailing-slash'

interface Params {
headers?: { [key: string]: string | string[] | undefined }
Expand Down Expand Up @@ -39,7 +38,6 @@ export function parseNextUrl({ headers, nextConfig, url = '/' }: Params) {
}
}

urlParsed.pathname = removePathTrailingSlash(urlParsed.pathname)
return urlParsed
}

Expand Down
1 change: 0 additions & 1 deletion test/production/react-18-streaming-ssr/index.test.ts
@@ -1,7 +1,6 @@
import { createNext } from 'e2e-utils'
import { NextInstance } from 'test/lib/next-modes/base'
import { fetchViaHTTP, renderViaHTTP } from 'next-test-utils'
import webdriver from 'next-webdriver'

describe('react 18 streaming SSR in minimal mode', () => {
let next: NextInstance
Expand Down

0 comments on commit de0b5a4

Please sign in to comment.