nitefood / asn

ASN / RPKI validity / BGP stats / IPv4v6 / Prefix / URL / ASPath / Organization / IP reputation / IP geolocation / IP fingerprinting / Network recon / lookup API server / Web traceroute server
MIT License
1.31k stars 159 forks source link

fix: quoting issues in json #30

Closed aorith closed 2 years ago

aorith commented 2 years ago

Some fields like holder may contain double quotes which need to be escaped.


$ bash -x ./asn -J 1547

[ ... ]

+ json_to_print+='"results":[{"asn":"1547","asname":"IDK-NETWORK, MD","org":"N/A","holder":"Societatea mixta pe actiuni de tip inchis "Interdnestrcom"","abuse_contacts":

[ ... ]

+ [[ true = true ]]
++ jq -M .
parse error: Invalid numeric literal at line 1, column 297
+ json_to_print=
+ echo -e ''

+ exit 0
nitefood commented 2 years ago

Looking good, thanks!