Unverified Commit fdcc24be authored by Jan Potoms's avatar Jan Potoms Committed by GitHub
parent 1a838f45
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
"loader-utils": "2.0.0", "loader-utils": "2.0.0",
"mini-css-extract-plugin": "0.8.0", "mini-css-extract-plugin": "0.8.0",
"mkdirp": "0.5.3", "mkdirp": "0.5.3",
"native-url": "0.3.1", "native-url": "0.3.3",
"neo-async": "2.6.1", "neo-async": "2.6.1",
"pnp-webpack-plugin": "1.6.4", "pnp-webpack-plugin": "1.6.4",
"postcss": "7.0.29", "postcss": "7.0.29",
......
...@@ -38,6 +38,9 @@ const Page = () => ( ...@@ -38,6 +38,9 @@ const Page = () => (
> >
<a id="catch-all-enc">Catch-all route (encoded)</a> <a id="catch-all-enc">Catch-all route (encoded)</a>
</Link> </Link>
<Link href="/p1/p2/all-ssr/[...rest]" as="/p1/p2/all-ssr/:42">
<a id="catch-all-colonnumber">Catch-all route :42</a>
</Link>
<Link href="/p1/p2/all-ssg/[...rest]" as="/p1/p2/all-ssg/hello"> <Link href="/p1/p2/all-ssg/[...rest]" as="/p1/p2/all-ssg/hello">
<a id="ssg-catch-all-single">Catch-all route (single)</a> <a id="ssg-catch-all-single">Catch-all route (single)</a>
</Link> </Link>
......
...@@ -240,6 +240,21 @@ function runTests(dev) { ...@@ -240,6 +240,21 @@ function runTests(dev) {
} }
}) })
it("[catch-all] shouldn't fail on colon followed by double digits in the path", async () => {
// https://github.com/GoogleChromeLabs/native-url/issues/27
let browser
try {
browser = await webdriver(appPort, '/')
await browser.elementByCss('#catch-all-colonnumber').click()
await browser.waitForElementByCss('#all-ssr-content')
const text = await browser.elementByCss('#all-ssr-content').text()
expect(text).toBe('{"rest":[":42"]}')
} finally {
if (browser) await browser.close()
}
})
it('[ssg: catch all] should pass param in getStaticProps during SSR', async () => { it('[ssg: catch all] should pass param in getStaticProps during SSR', async () => {
const data = await renderViaHTTP( const data = await renderViaHTTP(
appPort, appPort,
......
...@@ -10675,9 +10675,10 @@ native-or-bluebird@^1.2.0: ...@@ -10675,9 +10675,10 @@ native-or-bluebird@^1.2.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/native-or-bluebird/-/native-or-bluebird-1.2.0.tgz#39c47bfd7825d1fb9ffad32210ae25daadf101c9" resolved "https://registry.yarnpkg.com/native-or-bluebird/-/native-or-bluebird-1.2.0.tgz#39c47bfd7825d1fb9ffad32210ae25daadf101c9"
native-url@0.3.1: native-url@0.3.3:
version "0.3.1" version "0.3.3"
resolved "https://registry.yarnpkg.com/native-url/-/native-url-0.3.1.tgz#5045c65d0eb4c3ee548d48e3cb50797eec5a3c54" resolved "https://registry.yarnpkg.com/native-url/-/native-url-0.3.3.tgz#09300f35416a49f79f6f8ab9e3c05c53c2873666"
integrity sha512-EEHLiNEIgcTjctwlREZjUT1vdMlrmug+fr0sQ3hoP9+cO3cyhd5fJ0GTnINcnv9LtXL+NdovWNUMDIfW98l2eA==
dependencies: dependencies:
querystring "^0.2.0" querystring "^0.2.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment