api: rework url parsing

- tlds are now parsed and validated correctly (e.g. ".co.uk" works now)
- url patterns are pre-compiled instead of being compiled for every request
- aliases are computed in a safe manner using the URL object where possible
This commit is contained in:
dumbmoron
2023-12-09 11:00:54 +00:00
parent 64790b9820
commit dd563eb752
5 changed files with 116 additions and 81 deletions

View File

@@ -36,6 +36,7 @@
"hls-parser": "^0.10.7",
"nanoid": "^4.0.2",
"node-cache": "^5.1.2",
"psl": "^1.9.0",
"set-cookie-parser": "2.6.0",
"undici": "^5.19.1",
"url-pattern": "1.0.3",