-
Notifications
You must be signed in to change notification settings - Fork 55
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
Wrong group name validation if name provided with spaces [source code] #559
Comments
Actually I think just encoding the group name is the bug. The implicitly-invoked GroupCollectionRequest inside getAzureClient().group().buildRequest().select().get() is encoding the entire URL, so what you end up with is "Group%2B%Name%2BWith%2BSpaces" in the actual URL. If you switch out '+' with '%20', then you'd end up with "Group%2520Name%2520With%2520Spaces", also not what you want. The solution, I believe, is to leave the group name alone (i.e. not attempt to encode it) and let the request encode it instead. But I sense a Chesterton's fence here and I'm reluctant to remove it without knowing why it's there in the first place. |
check the git blame on that line it was added for a reason. |
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Jenkins deployed with official helm chart on Kubernetes cluster
Reproduction steps
Reproducing logic of this function via Jenkins Script Console:
So this validation wont work with groups names which contain spaces.
Expected Results
validateGroup function validates group with spaces in its name
Actual Results
validateGroup function does not validate group with spaces in its name
Anything else?
As a solution need to replace all '+' to '%20' after encoding (did not test it, maybe need to replace it back to space ' ')
I think encoding may affect other special characters
Are you interested in contributing a fix?
No response
The text was updated successfully, but these errors were encountered: