Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caplin rpc doesn't ignore extra slashes in request #12058

Open
errge opened this issue Sep 21, 2024 · 0 comments
Open

caplin rpc doesn't ignore extra slashes in request #12058

errge opened this issue Sep 21, 2024 · 0 comments

Comments

@errge
Copy link
Contributor

errge commented Sep 21, 2024

System information

Erigon version: 3.00.0-alpha3-92d8c174
OS & Version: Linux
Commit hash: 92d8c17
Erigon Command (with flags/config): /erigon --datadir ./data --prune.mode archive --http.api=eth,erigon,web3,net,debug,trace,txpool --caplin.archive --beacon.api beacon,builder,config,debug,events,node,validator,lighthouse --diagnostics.disabled --nat none --private.api.addr --beacon.api.port 3500 --http.port 8545 --ws --ws.port 8546 --authrpc.port 8551 --torrent.port 20202 --port 30303 --p2p.protocol 68 --p2p.allowed-ports 30303 --caplin.discovery.tcpport 40404 --caplin.discovery.port 40404 --sentinel.port 50505 --rpc.batch.limit 50000 --db.read.concurrency 8 --rpc.returndata.limit 100000000000
Consensus Layer: caplin
Consensus Layer Command (with flags/config): internal in erigon command
Chain/Network: mainnet

Expected behaviour

curl http://localhost:3500//eth/v1/beacon/headers/1 should return the content.

Actual behaviour

curl http://localhost:3500//eth/v1/beacon/headers/1 returns 404.

Steps to reproduce the behaviour

Install erigon with internalcl and then try to use any caplin rpc with slashes duplicated

Backtrace

No segfault, just 404 page not found

Discussion

I understand that this can be considered an incorrect request, but all normal HTTP servers ignore double slashes in URLs, e.g. the EL rpc part of erigon works if I do the same.

Double slashes can appear in request URLs unfortunately, e.g. with client libraries where one has to pass in a base_url and the end-user passes in http://localhost:3500/ instead of http://localhost:3500.

Or they can happen because of (kinda) incorrect reverse proxy configurations.

The usual approach on the server side is to ignore these duplications, e.g. this URL works on github: https://github.com//swagger-api/swagger-codegen///releases/tag/v3.0.62

Please note that the issue is not only at the beginning of the URL, but everywhere, for example http://localhost:3500/eth/v1/beacon//headers/1 also doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant