[next] Ensure correct route order for i18n + custom-routes (#5421)

Co-authored-by: Steven <steven@ceriously.com>
This commit is contained in:
JJ Kasper
2020-11-14 16:13:08 -06:00
committed by GitHub
parent 81e4c9e6fe
commit 0f42a63c03
4 changed files with 398 additions and 37 deletions

View File

@@ -251,7 +251,9 @@ async function testDeployment(
const expected = probe.responseHeaders[header];
const isEqual = Array.isArray(expected)
? expected.every(h => actual.includes(h))
: expected.startsWith('/') && expected.endsWith('/')
: typeof expected === 'string' &&
expected.startsWith('/') &&
expected.endsWith('/')
? new RegExp(expected.slice(1, -1)).test(actual)
: expected === actual;
if (!isEqual) {