feat(new tool): Outlook Safelink Decoder (#911)

* feat(new tool): Outlook Safelink Decoder

Fix #897

* Use native URL parsing

Co-authored-by: Corentin THOMASSET <corentin.thomasset74@gmail.com>

* Update src/tools/safelink-decoder/index.ts

---------

Co-authored-by: Corentin THOMASSET <corentin.thomasset74@gmail.com>
This commit is contained in:
sharevb 2024-03-11 11:19:32 +01:00 committed by GitHub
parent fe349ad69b
commit d3b32cc14e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 74 additions and 1 deletions

View file

@ -0,0 +1,7 @@
export function decodeSafeLinksURL(safeLinksUrl: string) {
if (!safeLinksUrl.match(/\.safelinks\.protection\.outlook\.com/)) {
throw new Error('Invalid SafeLinks URL provided');
}
return new URL(safeLinksUrl).searchParams.get('url');
}