Skip to content

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
- [ ] The Jira issue, if it exists, is well-described.
- [ ] The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see [examples](https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml)). Fill in the **Proposed upgrade guidelines** section only if there are breaking changes or changes that may require extra steps from users during upgrade.
- [ ] There is automated testing or an explanation as to why this change has no tests.
- [ ] New public classes, fields, and methods are annotated with `@Restricted` or have `@since TODO` Javadocs, as appropriate.
- [ ] New deprecations are annotated with `@Deprecated(since = "TODO")` or `@Deprecated(forRemoval = true, since = "TODO")`, if applicable.
- [ ] New or substantially changed JavaScript is not defined inline and does not call `eval` to ease future introduction of Content Security Policy (CSP) directives (see [documentation](https://www.jenkins.io/doc/developer/security/csp/)).
- [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [ ] For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

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

### Maintainer checklist
- [ ] There are at least two (2) approvals for the pull request and no outstanding requests for change.
- [ ] Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
- [ ] Changelog entries in the pull request title and/or **Proposed changelog entries** are accurate, human-readable, and in the imperative mood.
- [ ] Proper changelog labels are set so that the changelog can be generated automatically.
- [ ] If the change needs additional upgrade steps from users, the `upgrade-guide-needed` label is set and there is a **Proposed upgrade guidelines** section in the pull request title (see [example](https://github.com/jenkinsci/jenkins/pull/4387)).
- [ ] If it would make sense to backport the change to LTS, a Jira issue must exist, be a _Bug_ or _Improvement_, and be labeled as `lts-candidate` to be considered (see [query](https://issues.jenkins.io/issues/?filter=12146)).

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]>
@welcome
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.

<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
@MarkEWaite MarkEWaite added the bug For changelog: Minor bug. Will be listed after features label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug For changelog: Minor bug. Will be listed after features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants