Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
TelcoDB
Web Frontend
Commits
a83bb94f
Verified
Commit
a83bb94f
authored
Oct 21, 2019
by
Elias Ojala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle Sender ID records and AzureWebsites ALIAS TXT records
parent
384c4cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
src/view-functions/txtParser.ts
src/view-functions/txtParser.ts
+17
-2
No files found.
src/view-functions/txtParser.ts
View file @
a83bb94f
function
txtParser
(
record
:
string
):
string
{
if
(
record
.
includes
(
"
v=spf1
"
))
{
/**
* SPF & Sender ID records
*
* See https://telcodb.net/dns/amazon.com for example.
*/
if
(
record
.
includes
(
"
v=spf1
"
)
||
record
.
includes
(
"
spf2.0/pra
"
))
{
record
=
record
.
replace
(
/
(
include|ip4|ip6|a
)\:([^\s]
+
)
/g
,
'
$1:<a href="/search?q=$2">$2</a>
'
);
record
=
record
.
replace
(
/
(
redirect
)\=([^\s]
+
)
/g
,
'
$1=<a href="/search?q=$2">$2</a>
'
);
...
...
@@ -7,7 +12,17 @@ function txtParser(record: string): string {
return
record
;
}
// Default
/**
* AzureWebsites, behind Cloudflare
*
* Example: https://telcodb.net/dns/haveibeenpwned.com
*/
if
(
record
.
includes
(
"
ALIAS for
"
)
&&
record
.
includes
(
"
azure
"
))
{
record
=
record
.
replace
(
/ALIAS for
([^\s]
+
)
/
,
'
ALIAS for <a href="/dns/$1">$1</a>
'
);
return
record
;
}
return
record
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment