Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
eef8f1f3
Unverified
Commit
eef8f1f3
authored
Apr 23, 2020
by
Kiarash Zarinmehr
Committed by
GitHub
Apr 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Server Lib Utilities (#12119)
parent
91adb866
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
normalize-page-path.ts
packages/next/next-server/server/normalize-page-path.ts
+1
-1
utils.ts
packages/next/next-server/server/utils.ts
+1
-1
No files found.
packages/next/next-server/server/normalize-page-path.ts
View file @
eef8f1f3
...
@@ -5,7 +5,7 @@ export function normalizePagePath(page: string): string {
...
@@ -5,7 +5,7 @@ export function normalizePagePath(page: string): string {
page
=
'/index'
page
=
'/index'
}
}
// Resolve on anything that doesn't start with `/`
// Resolve on anything that doesn't start with `/`
if
(
page
[
0
]
!==
'/'
)
{
if
(
!
page
.
startsWith
(
'/'
)
)
{
page
=
`/
${
page
}
`
page
=
`/
${
page
}
`
}
}
// Throw when using ../ etc in the pathname
// Throw when using ../ etc in the pathname
...
...
packages/next/next-server/server/utils.ts
View file @
eef8f1f3
import
{
BLOCKED_PAGES
}
from
'../lib/constants'
import
{
BLOCKED_PAGES
}
from
'../lib/constants'
export
function
isBlockedPage
(
pathname
:
string
):
boolean
{
export
function
isBlockedPage
(
pathname
:
string
):
boolean
{
return
BLOCKED_PAGES
.
in
dexOf
(
pathname
)
!==
-
1
return
BLOCKED_PAGES
.
in
cludes
(
pathname
)
}
}
export
function
cleanAmpPath
(
pathname
:
string
):
string
{
export
function
cleanAmpPath
(
pathname
:
string
):
string
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment