Escape JSON on Tor relay page and other general improvements

parent a30b3f57
......@@ -237,8 +237,8 @@ twig.extendFunction("getBadge", (badgeName: string, asn?: number, pdb?, pdbDataT
if (asn && badgeName === "cymru") {
data.url = `https://api.telcodb.net/v1/asn/cymru?format=json&q=${asn}`;
} else if(asn && badgeName === "asr") {
suffix = `/asns/3356`;
} else if(asn && badgeName === "caida-asrank") {
suffix = `/asns/${asn}`;
} else if (pdb && badgeName === "peeringdb" && pdbDataType === "orgPage") {
suffix = `/org/${pdb.org.id}`;
} else if (pdb && badgeName === "peeringdb" && pdbDataType === "netPage") {
......
......@@ -23,7 +23,8 @@
<p class="mb-2">The JSON version currently has the following extra features that are not available on the original/TXT version:
<ul>
<li>Tor relay fingerprint</li>
{# <li><a href="https://en.wikipedia.org/wiki/Reverse_DNS_lookup">Reverse DNS</a> records</li> #}
<li><a href="https://en.wikipedia.org/wiki/Forward-confirmed_reverse_DNS">Forward-confirmed reverse DNS</a> records</li>
<li>Array containing <a href="https://metrics.torproject.org/glossary.html#relay-flag">relay flags</a> in English</li>
</ul></p>
<p>The data is automatically updated to the forementioned endpoints,
......
......@@ -27,6 +27,7 @@
<li><a href="https://www.dan.me.uk/dnsbl">Tor Relay DNSBL by dan.me.uk</a></li>
<li><a href="/docs/tor-relay-list/">Tor Relay List in JSON format</a>
(based on <a href="https://www.dan.me.uk/tornodes">dan.me.uk</a>'s data)</li>
<li><a href="https://metrics.torproject.org/onionoo.html">Onionoo</a></li>
</ul>
</p>
......
......@@ -33,6 +33,7 @@
<td>{{ relay.router_port|e }}</td>
<td>{{ relay.directory_port|e }}</td>
<td>{{ relay.flags|e }}</td>
{# <td>{{ relay.flags_alt|join(', ')|e }}</td> #}
{# TODO: #}
<td data-order="{{ relay.uptime|e }}">{{ relay.uptime|e }}</td>
<td>{{ relay.version|e }}</td>
......
......@@ -3,5 +3,5 @@
{% block body %}
<h1>{{ title|e }}</h1>
<pre><code>{{ json_data }}</code></pre>
<pre><code>{{ json_data|e }}</code></pre>
{% endblock %}
\ No newline at end of file
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