removed some todos and fixed comment according to martins suggestion

This commit is contained in:
renaynay 2020-03-30 18:04:09 +02:00
parent c4f6bfc5af
commit f9f85c4bba
No known key found for this signature in database
GPG key ID: 731E44FAAFCD0274
3 changed files with 5 additions and 5 deletions

View file

@ -543,7 +543,7 @@ func signer(c *cli.Context) error {
err := node.RegisterApisFromWhitelist(rpcAPI, []string{"account"}, srv, false)
if err != nil {
utils.Fatalf("Could not register API: %w", err) // TODO should this be a fatal failure?
utils.Fatalf("Could not register API: %w", err)
}
handler := node.NewHTTPHandlerStack(srv, cors, vhosts)

View file

@ -892,7 +892,7 @@ func retesteth(ctx *cli.Context) error {
err := node.RegisterApisFromWhitelist(rpcAPI, []string{"test", "eth", "debug", "web3"}, srv, false)
if err != nil {
utils.Fatalf("Could not register RPC apis: %w", err) // TODO should this be a fatal error?
utils.Fatalf("Could not register RPC apis: %w", err)
}
handler := node.NewHTTPHandlerStack(srv, cors, vhosts)

View file

@ -52,9 +52,9 @@ func newCorsHandler(srv http.Handler, allowedOrigins []string) http.Handler {
}
// virtualHostHandler is a handler which validates the Host-header of incoming requests.
// The virtualHostHandler can prevent DNS rebinding attacks, which do not utilize CORS-headers,
// since they do in-domain requests against the RPC api. Instead, we can see on the Host-header
// which domain was used, and validate that against a whitelist.
// Using virtual hosts can help prevent DNS rebinding attacks, where a 'random' domain name points to
// the service ip address (but without CORS headers). By verifying the targeted virtual host, we can
// ensure that it's a destination that the node operator has defined.
type virtualHostHandler struct {
vhosts map[string]struct{}
next http.Handler