From f9ae99a440a0b31d05d0af8acfb1d8dfbd1b3f83 Mon Sep 17 00:00:00 2001 From: Elias Ojala Date: Tue, 10 Mar 2020 15:04:54 +0200 Subject: [PATCH] Improve SPF parser on RFC7208 --- src/view-functions/txtParser.ts | 3 ++- views/docs/index.twig | 2 ++ views/home/about.twig | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/view-functions/txtParser.ts b/src/view-functions/txtParser.ts index 6413a86..d9ef862 100644 --- a/src/view-functions/txtParser.ts +++ b/src/view-functions/txtParser.ts @@ -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:$2'); + // https://tools.ietf.org/html/rfc7208#section-5 + record = record.replace(/(a|mx|ptr|ip4|ip6|include)\:([^\s]+)/g, '$1:$2'); record = record.replace(/(redirect)\=([^\s]+)/g, '$1=$2'); diff --git a/views/docs/index.twig b/views/docs/index.twig index 75269b8..e789a7d 100644 --- a/views/docs/index.twig +++ b/views/docs/index.twig @@ -86,6 +86,7 @@ location: https://
  • List of Speedtest.net servers in JSON
  • + {#

    DNS-over-HTTPS

    See our DNS resolver's privacy policy here.

    + #} {% endblock %} \ No newline at end of file diff --git a/views/home/about.twig b/views/home/about.twig index c4ace9e..47defdb 100644 --- a/views/home/about.twig +++ b/views/home/about.twig @@ -39,7 +39,12 @@

    -

    Contact

    +

    Source code

    + +

    Source code of TelcoDB is available at + our GitLab.

    + +

    Contact

    Our contact address is contact@telcodb.net.

    -- GitLab