[JENKINS-75320] use the url for linking#10308
Conversation
Signed-off-by: Thorsten Scherler <scherler@gmail.com>
|
/label bug |
|
Since you've labelled it as a bug can you please add a changelog entry |
Signed-off-by: Thorsten Scherler <scherler@gmail.com>
|
@timja added an entry @janfaracik good catch, forgot about the possible rootUrl, cheers |
|
@janfaracik @timja @daniel-beck @basil could you have a look? |
|
/label ready-for-merge This PR is now ready for merge, after the upcoming security release we will merge it if there's no negative feedback. Thanks! |
| <j:forEach var="i" items="${items}"> | ||
| <li id="item_${i.path}"> | ||
| <a href="?q=${h.urlEncode(i.path)}">${i.path}</a> | ||
| <a href="${rootURL}/${i.url}">${i.path}</a> |
There was a problem hiding this comment.
When the rootURL is empty this leads to a url that starts with a double slash. This results in a url like https://design-library (see https://weekly.ci.jenkins.io/search/?q=g)
So when i.url starts with a slash it must be removed first. Not sure but it seems the url is always absolute with respect to the root url so just removing the slash in here might be enough.

See JENKINS-75320. when searching https://ci.jenkins.io//search/?q=junit the linking is wrong, adopt the new URL instead
Testing done
to test you need to create first a folder and then create a job (e.g. named 1) in the folder. then you need to request http://localhost:8080/search/?q=1 without the fix the link will point to
http://localhost:8080/search/?q=folder+%C2%BB+1Proposed changelog entries
Proposed changelog category
/label bug
Proposed upgrade guidelines
N/A
Submitter checklist
@Restrictedor have@since TODOJavadocs, as appropriate.@Deprecated(since = "TODO")or@Deprecated(forRemoval = true, since = "TODO"), if applicable.evalto ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@mention @janfaracik @timja @daniel-beck @basil
Before the changes are marked as
ready-for-merge:Maintainer checklist
upgrade-guide-neededlabel is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidateto be considered (see query).