Improve SPF parser on RFC7208

parent fe463f0b
Pipeline #74 passed with stage
in 5 minutes and 15 seconds
......@@ -5,7 +5,8 @@ function txtParser(record: string): string {
* 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|ptr)\:([^\s]+)/g, '$1:<a href="/search?q=$2">$2</a>');
// https://tools.ietf.org/html/rfc7208#section-5
record = record.replace(/(a|mx|ptr|ip4|ip6|include)\:([^\s]+)/g, '$1:<a href="/search?q=$2">$2</a>');
record = record.replace(/(redirect)\=([^\s]+)/g, '$1=<a href="/search?q=$2">$2</a>');
......
......@@ -86,6 +86,7 @@ location: <a href="https://peeringdb.com/api/net/291" class="text-dark">https://
<li><a href="/docs/speedtest-servers-json/">List of Speedtest.net servers in JSON</a></li>
</ul>
{#
<h2>DNS-over-HTTPS</h2>
<ul>
......@@ -94,4 +95,5 @@ location: <a href="https://peeringdb.com/api/net/291" class="text-dark">https://
</ul>
<p>See our DNS resolver's privacy policy <a href="https://lelux.fi/resolver/#privacy-policy">here</a>.</p>
#}
{% endblock %}
\ No newline at end of file
......@@ -39,7 +39,12 @@
</p>
<a name="contact"></a><h3>Contact</h3>
<a name="source-code"></a><h2>Source code</h2>
<p>Source code of TelcoDB is available at
<a href="https://gitlab.lelux.fi/TelcoDB">our GitLab</a>.</p>
<a name="contact"></a><h2>Contact</h2>
<p>Our contact address is
<a href="mailto:contact+2019@telcodb.net">contact@telcodb.net</a>.</p>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment