mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-06-20 21:20:41 -04:00
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:
parent
fe349ad69b
commit
d3b32cc14e
5 changed files with 74 additions and 1 deletions
7
src/tools/safelink-decoder/safelink-decoder.service.ts
Normal file
7
src/tools/safelink-decoder/safelink-decoder.service.ts
Normal 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');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue