mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
removed some todos and fixed comment according to martins suggestion
This commit is contained in:
parent
c4f6bfc5af
commit
f9f85c4bba
3 changed files with 5 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue