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
ethstats: fix URL parser for '@' or ':' in nodename #21640
ethstats: fix URL parser for '@' or ':' in nodename #21640
Conversation
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Hm, quirky that we didn't use the proper syntax from the beginning, with
|
{ | ||
url: `name:@ws://mordor.dash.fault.dev:3000`, | ||
node: "name", pass: "", host: "ws://mordor.dash.fault.dev:3000", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name@ws://mordor.dash.fault.dev
should also work (without the :
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least if it worked before...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roger. Not sure if it did before... but it does now 😂
Addresses review ethereum#21640 (review) Signed-off-by: meows <b5c6@protonmail.com>
Addresses review ethereum/go-ethereum#21640 (review) Signed-off-by: meows <b5c6@protonmail.com>
Damn. This is one of these cases where we should really use the stdlib URL parser. It can handle this. |
Well, would have been able to handle proper usename:pw-urls, but we used some bastard format, so I doubt it can :)
|
I think we can attempt to change it to the standard format. I don't think it's common for anyone to explicitly specify ws or wss. That was important to me to make it work without having to care about SSL or not. So if we assume it's not a used feature, we can move the position of |
Another issue is the user info field. Currently the bastard pattern supports arbitrary unencoded user strings, like
(with spaces and delimiters) and stuff. RFC3986 (and the standard lib Handling this on the backend (doing the encoding before parsing) is obviously possible, but will add complexity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, and sorry for the very delayed review!
…um#21640) Fixes the case (example below) where the value passed to --ethstats flag would be parsed wrongly because the node name and/or password value contained the special characters '@' or ':' --ethstats "ETC Labs Metrics @meowsbits":mypass@ws://mordor.dash.fault.dev:3000
…um#21640) Fixes the case (example below) where the value passed to --ethstats flag would be parsed wrongly because the node name and/or password value contained the special characters '@' or ':' --ethstats "ETC Labs Metrics @meowsbits":mypass@ws://mordor.dash.fault.dev:3000
…um#21640) Fixes the case (example below) where the value passed to --ethstats flag would be parsed wrongly because the node name and/or password value contained the special characters '@' or ':' --ethstats "ETC Labs Metrics @meowsbits":mypass@ws://mordor.dash.fault.dev:3000
Fixes the case (example below) where the value passed to
--ethstats
flag would be parsed wrongly because the nodename and/or password value contained "special" characters@
or:
.--ethstats "ETC Labs Metrics @meowsbits":mypass@ws://mordor.dash.fault.dev:3000