okTurtles / dnschain

A blockchain-based DNS + HTTP server that fixes HTTPS security, and more!
https://okturtles.com
Other
1.73k stars 170 forks source link

Don't allow disabled/non-existing blockchains to be queried #87

Closed taoeffect closed 9 years ago

taoeffect commented 9 years ago

Something I noticed while testing @SGrondin's HTTPS stuff:

2014-12-12T07:59:34.159Z - debug: [HTTPS] null 1 null 178
2014-12-12T07:59:34.160Z - debug: [HTTPS] Tunnel: null (https.coffee:104)
2014-12-12T07:59:34.185Z - debug: [HTTP] request (<callback> http.coffee:47) 
{ path: 'id/greg', url: '/id/greg' }
2014-12-12T07:59:34.185Z - debug: [BDNS] bdns resolve (<resolve> bdns.coffee:40) 
{ path: 'id/greg' }
2014-12-12T07:59:34.186Z - debug: [HTTP] request (<callback> http.coffee:47) 
{ path: 'rpc', url: '/rpc' }
2014-12-12T07:59:34.186Z - warn: [HTTP] unknown host type: 127.0.0.1 -- defaulting to namecoin.dns! (http.coffee:58)
2014-12-12T07:59:34.187Z - debug: [HTTP] ignoring request for: rpc (<callback> http.coffee:62)
2014-12-12T07:59:34.187Z - debug: [HTTP] resolver failed (http.coffee:67) 
{ err: {} }

If any of the supported blockchains are not located on the server, requests to them should return 400 Bad Request.

taoeffect commented 9 years ago

Changed return type to 400 Bad Request

taoeffect commented 9 years ago

Great job on closing this @WeMeetAgain!