-
Notifications
You must be signed in to change notification settings - Fork 84
CORS configuration invalid #332
Comments
The regex produced by this piece of code for See this question |
Apologies, my fingers got ahead of me - taking a look now.. |
I'm investigating as well. It doesn't look the problem is the regex. I am using an ethers JsonRpcProvider to access a local EthSigner. I'm trying to debug EthSigner on the other side. I guess it's because those are passthrough methods, and the downstream is the one that should be responding CORS headers. Is this the case? |
Hi @tuler,
Are you running with Besu, or a different web3provider? |
I'm not running Besu. |
Update: When pairing EthSigner with Besu, we see eth_chainId working correctly (i.e. the returned access-control-allow-origin header has only a single "*") I'm wondering what builderevm node does with CORS - Ethsigner deliberately removes the "ORIGIN" header from the proxied request, so the web3provider shouldn't know about CORS ... Can I beg for a quick debug? If you can, it'd be interesting to put a debug point in ForwardedMessageResponder::handleResponse, just to confirm the headers in the response created by builderevm. |
I did what you asked a couple minutes ago. I was writing this message. buidlerevm
Then this line add those headers, causing the duplicate issue. |
@tuler thanks for sending that through - so, it looks like builderevm is responding with CORS headers, even without having received a CORS header in the request. Wondering if Ethsigner should strip the "access-control-allow-origins" headers from proxied responses - we had figured that stripping "ORIGIN" from the incoming request was enough, but it may be worth going a step further. |
Yes, I think those response headers should be handled some other way. |
Generally we need to copy back the headers (they're just as important as the body) - but we could deliberately discard the "access-control-allow-origin" when we copy the headers across - we'll get up a PR. |
I'm trying to setup CORS so I can access the signer in development from an application running at
localhost:8000
.I tried
"*"
,"all"
and"http://localhost:8000"
, but they all seem to add an extra*
to the header.The text was updated successfully, but these errors were encountered: