mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
[e2e] Prevent slashes in generated project names (#28835)
* Prevent slashes in generated project names by using base64url encoding (replaces `+` and `/` by `-` and `_`) * Keep base64 (Missing baseUrl in compilerOptions) and replace the slash manually GitOrigin-RevId: 62217873de8d1e00e72927a5195338ad92c09769
This commit is contained in:
@@ -141,6 +141,7 @@ export function getSpamSafeProjectName() {
|
||||
// Move from hex/16 to base64/64 possible characters per char in string
|
||||
const name = Buffer.from(uuid().replaceAll('-', ''), 'hex')
|
||||
.toString('base64')
|
||||
.replace('/', '_')
|
||||
.slice(0, 10)
|
||||
const nDigits = (name.match(/\d/g) || []).length
|
||||
if (nDigits < 6) return name
|
||||
|
||||
Reference in New Issue
Block a user