fix `Access-Control-Allow-Origin` response (#5028)
Since #3976, CORS functionality is broken. Fix it to work again: - Use `--rest-allowed-origin` instead of `--keymanager-allowed-origin` to specify CORS `Access-Control-Allow-Origin` header for beacon-APIs. - Actually pass CORS config to `nim-presto` once more.
This commit is contained in:
parent
336acbd39b
commit
d99caf1ad9
|
@ -636,7 +636,7 @@ proc init*(T: type BeaconNode,
|
||||||
|
|
||||||
let restServer = if config.restEnabled:
|
let restServer = if config.restEnabled:
|
||||||
RestServerRef.init(config.restAddress, config.restPort,
|
RestServerRef.init(config.restAddress, config.restPort,
|
||||||
config.keymanagerAllowedOrigin,
|
config.restAllowedOrigin,
|
||||||
validateBeaconApiQueries,
|
validateBeaconApiQueries,
|
||||||
config)
|
config)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -356,7 +356,7 @@ proc init*(T: type RestServerRef,
|
||||||
maxRequestBodySize = config.restMaxRequestBodySize * 1024
|
maxRequestBodySize = config.restMaxRequestBodySize * 1024
|
||||||
|
|
||||||
let res = try:
|
let res = try:
|
||||||
RestServerRef.new(RestRouter.init(validateFn),
|
RestServerRef.new(RestRouter.init(validateFn, allowedOrigin),
|
||||||
address, serverFlags = serverFlags,
|
address, serverFlags = serverFlags,
|
||||||
httpHeadersTimeout = headersTimeout,
|
httpHeadersTimeout = headersTimeout,
|
||||||
maxHeadersSize = maxHeadersSize,
|
maxHeadersSize = maxHeadersSize,
|
||||||
|
|
Loading…
Reference in New Issue