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

URL encode directory names in "all files in zip" link #10084

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tchaikov
Copy link

Previously, directory names containing special characters (e.g., "[" or "]") would cause HTTP 400 errors due to illegal path characters. Now properly percent-encoding the directory name in the URL to handle special characters.

See JENKINS-XXXXX.

Testing done

Proposed changelog entries

  • human-readable text

Proposed upgrade guidelines

N/A

Submitter checklist

Preview Give feedback

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

Preview Give feedback

Previously, directory names containing special characters (e.g., "[" or "]")
would cause HTTP 400 errors due to illegal path characters. Now properly
percent-encoding the directory name in the URL to handle special characters.

Signed-off-by: Kefu Chai <[email protected]>
Copy link

welcome bot commented Dec 20, 2024

Yay, your first pull request towards Jenkins core was created successfully! Thank you so much!

A contributor will provide feedback soon. Meanwhile, you can join the chats and community forums to connect with other Jenkins users, developers, and maintainers.

@@ -114,7 +114,7 @@ THE SOFTWARE.
<tr>
<td style="text-align:right;" colspan="3">
<div style="margin-top: 1em;">
<a class="jenkins-link--with-icon" href="${backPath}${pattern!=''?pattern+'/':''}*zip*/${dir.name}.zip">
<a class="jenkins-link--with-icon" href="${backPath}${pattern!=''?pattern+'/':''}*zip*/${h.urlEncode(dir.name)}.zip">
Copy link
Member

@timja timja Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do spaces in the directory names still work?

We had a similar issue in the junit plugin and rawEncode had to be used instead of urlEncode

jenkinsci/junit-plugin#660 (comment)

jenkinsci/junit-plugin#661

and finally:
jenkinsci/junit-plugin#668

@timja
Copy link
Member

timja commented Dec 20, 2024

Could you please include how its been tested in the testing done, including the cases you've tried

@tchaikov
Copy link
Author

Could you please include how its been tested in the testing done, including the cases you've tried

Hi Tim

Thank you very much for your detailed insights and review. I haven't had the chance to properly test the changes yet. I will set up a local environment to verify the behavior you've described.

Since I'm not very familiar with Jenkins development and its setup process, it may take me some time to complete the testing. I'll update this PR once I've had a chance to verify everything locally.

@tchaikov tchaikov marked this pull request as draft December 26, 2024 08:29
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

Successfully merging this pull request may close these issues.

2 participants