Open 2-towns opened 2 days ago
@veaceslavdoina can you add x-real-ip-custom
to the ‘Access-Control-Allow-Headers’ ? I have a CORS error when trying to fetch
Done, and we can check it
curl \
https://echo.codex.storage/port/8070 \
-X OPTIONS \
-H 'X-Real-IP-Custom: 128.140.62.211' \
-H 'Access-Control-Request-Method: GET' \
-H 'Origin: http://localhost:3000/' \
-v
< access-control-allow-origin: *
< access-control-allow-methods: GET, POST, OPTIONS, HEAD
< access-control-allow-headers: X-Real-IP-Custom
Okay thanks.
Can you try it on https://releases-v0-0-13.codex-marketplace-ui.pages.dev/ ? @veaceslavdoina
Looks like we do not get/pass a port?
This is a check on a localhost
and same is with a remote node.
Oh sorry I had a proxy object intercepting the requests (for the tests). I think it is a bad idea I removed it, can you try it again ?
Works as expected on localhost with IPv4 and remote VM with IPv6, thank you for the fix.
The echo service, for some reason, is not using the ip parameter when trying to lookup the port (https://github.com/mpolden/echoip/blob/d84665c26cf7df612061e9c35abe325ba9d86b8d/http/http.go#L177C13-L177C26). But we should be able to give the IP by using the X-Forwarded-For header (https://github.com/mpolden/echoip/blob/d84665c26cf7df612061e9c35abe325ba9d86b8d/http/http.go#L93C43-L95)