wrong name regex to filter url when provide --name=www as parameter in cli#14575
wrong name regex to filter url when provide --name=www as parameter in cli#14575bkchr merged 1 commit intoparitytech:masterfrom
Conversation
koute
left a comment
There was a problem hiding this comment.
Technically URLs don't necessarily have to be for HTTP(S), so maybe we should just disallow URLs for any protocol?
had the same thought |
|
@michalkucharczyk hey another thing, can this hotfix pr cherry pick to polkadot-0.9.43 branch? oh maybe this contains in polkadotv1.0.0 is also ok |
|
@atenjin I don't see that this is a critical change that needs to be backported |
|
@bkchr sorry in our project, we are using this substrate branch in our chain, we meet this bug in our running service. |
|
Just don't remove the www from the name of your node. These names are only required for telemetry and nothing else and telemetry isn't important. |
| } | ||
|
|
||
| let invalid_patterns = r"(https?:\\/+)?(www)+"; | ||
| let invalid_patterns = r"^https?:\/\/"; |
There was a problem hiding this comment.
let invalid_patterns = r"^https?:\\/\\/";
Instead?
There was a problem hiding this comment.
I think you don't need to escape the /, so just r"^https?://" should work. Also none of the tests would catch this since the URLs also include a . so this condition is never tested. We could also just filter with r"^https?:/". A name like https:/myfunnywebsite.com is probably something we don't want either.
close #14574
In this pr, we just filter
http://https://prefix in the string, not including wordwww