Skip to content

Instantly share code, notes, and snippets.

@fardog
Created April 3, 2018 05:40
Show Gist options
  • Save fardog/a38fe78fafc79a543b4944a1b009a4ad to your computer and use it in GitHub Desktop.
Save fardog/a38fe78fafc79a543b4944a1b009a4ad to your computer and use it in GitHub Desktop.
cloudflare dns-over-https broken json
➜ ~ curl https://cloudflare-dns.com/dns-query\?ct\=application/dns-json\&name\=example.com\&type\=TXT
{"Status": 0,"TC": false,"RD": true, "RA": true, "AD": true,"CD": false,"Question":[{"name": "example.com.", "type": 16}],"Answer":[{"name": "example.com.", "type": 16, "TTL": 28, "data": ""v=spf1 -all""},{"name": "example.com.", "type": 16, "TTL": 28, "data": ""$Id: example.com 4415 2015-08-24 20:12:23Z davids $""}]}
➜ ~ curl https://cloudflare-dns.com/dns-query\?ct\=application/dns-json\&name\=example.com\&type\=TXT | python -m json.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 319 100 319 0 0 2614 0 --:--:-- --:--:-- --:--:-- 2593
Expecting ',' delimiter: line 1 column 191 (char 190)
➜ ~
{"Status": 0,"TC": false,"RD": true, "RA": true, "AD": true,"CD": false,"Question":[{"name": "example.com.", "type": 16}],"Answer":[{"name": "example.com.", "type": 16, "TTL": 28, "data": ""v=spf1 -all""},{"name": "example.com.", "type": 16, "TTL": 28, "data": ""$Id: example.com 4415 2015-08-24 20:12:23Z davids $""}]}
# wrapped to 80 characters; issue pointed out in between lines
{"Status": 0,"TC": false,"RD": true, "RA": true, "AD": true,"CD":
false,"Question":[{"name": "example.com.", "type": 16}],"Answer":[{"name":
"example.com.", "type": 16, "TTL": 28, "data": ""v=spf1 -all""},{"name":
^ invalid json, double-quoted
"example.com.", "type": 16, "TTL": 28, "data": ""$Id: example.com 4415
^ invalid json, double-quoted
2015-08-24 20:12:23Z davids $""}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment