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
Lodestar REST API should accept percent-encoded URIs #5403
Comments
Thanks @TobiWo for reporting! This is the behavior of a downstream library we are using called qs. quote from the author of
There is also a related issue for this ljharb/qs#311, the library initially treated URL encoded commas as reserved character which was considered a bug and the library added a test for this "parses comma delimited array while having percent-encoded comma treated as normal text". Considering all of this, I would say this is rather bug in the other clients. See #5280 for examples on what query array formats Lodestar supports currently (tl;dr |
@nflaig That makes a lot of sense. Thanks for clarifying. The question is, how to proceed here? Should I/we open issues in all other client repositories 😉 ? Probably this is too much? In general it would be nice that all clients handle REST requests the same way ofc. Maybe you can bring this up in an ACDC call? Don't know if this is too much as well because there are probably much more important stuff to discuss in these calls. |
Yeah definitely looks like it, the libraries treat
It looks like array queries like
This is rather an implementation detail so I would say an issue on the respective client repository is the better approach. Would still be interesting to see what comes out of that, I would assume what happens in the other clients is that they apply URI decoding before parsing the query which is definitely incorrect and should be fixed. Might even be a breaking change if they fix this bug as downstream tooling might rely on it at this point... |
@nflaig @TobiWo I would probably bring this up to the ETH R&D Discord (maybe |
Hi @philknows, I was just reading through @nflaig answer and thought that opening an issue in every repository is a bit repetitive. Your suggested approach sounds much better. I will go forward with that idea. |
Sounds good to me, thanks for driving this @TobiWo 👍 |
@TobiWo did you get a response from other client teams on this? I can also just bring it up in discord if you'd like, looking at some interop issues right now so it is good time to also look at this |
Closing this issue, thanks for clearing this up @nflaig |
Describe the bug
Note: This report assumes the Lodestar beacon api can be reached on
http://localhost:5054
Lodestar does not accept URL percent-encoding for params send via a get request.
For example, sending a request via curl:
This works:
This does not work:
Expected behavior
Lodestar should accept percent-encoded URIs like so:
Percent-encoding is a widely accepted standard and should also work with Lodestar. Also I tested this with most other clients (Lighthouse, Teku and Nimbus) and all three accept percent-encoding. Therefore Lodestar would be in line with these other clients.
Steps to Reproduce
Curl lodestar API endpoint with percent-encoded URI:
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: