taiko-mono icon indicating copy to clipboard operation
taiko-mono copied to clipboard

fix(eventindexer): remove redundant opts.CorsOrigins check

Open ddl-hust opened this issue 9 months ago • 0 comments

there's a logical issue in the handling of corsOrigins: the Validate method checks if opts.CorsOrigins is nil, and if so, returns an error eventindexer.ErrNoCORSOrigins. However, in the NewServer method, even if opts.CorsOrigins is nil, it's set to a default value of []string{"*"}.

cause the check in the Validate method is redundant, as the nil case is already handled in the NewServer method.

ddl-hust avatar May 23 '24 08:05 ddl-hust