Commit 742f29fb authored by Luis Fernando Alvarez D's avatar Luis Fernando Alvarez D Committed by Joe Haddad

buildId is not an ad (#6851)

* Added a check for ad_ in the buildId

* ad_ > ad
Co-Authored-By: 's avatarlfades <luis@zeit.co>

* Update the `ad` comment
Co-Authored-By: 's avatarlfades <luis@zeit.co>
parent e25312b7
...@@ -2,7 +2,11 @@ export async function generateBuildId (generate: () => string|null, fallback: () ...@@ -2,7 +2,11 @@ export async function generateBuildId (generate: () => string|null, fallback: ()
let buildId = await generate() let buildId = await generate()
// If there's no buildId defined we'll fall back // If there's no buildId defined we'll fall back
if (buildId === null) { if (buildId === null) {
buildId = fallback() // We also create a new buildId if it starts with `ad` to avoid false
// positives with ad blockers
while (!buildId || buildId.startsWith('ad')) {
buildId = fallback()
}
} }
if (typeof buildId !== 'string') { if (typeof buildId !== 'string') {
......
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