Skip to content

Commit 9c7f319

Browse files
authored
Fix url in search result list when running at root context (jenkinsci#10725)
fix url when running at root when the rootURL is empty the urls would start with a double slash which is interpreted by browser like a complete url including domain. That leads to non working links. Use the same approach for the url as used by command pallete to include the additional slash only when the url is not starting with a slash
1 parent a2b5d82 commit 9c7f319

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/resources/hudson/search/Search/search-failed.jelly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ THE SOFTWARE.
4343
<ol>
4444
<j:forEach var="i" items="${items}">
4545
<li id="item_${i.path}">
46-
<a href="${rootURL}/${i.url}">${i.path}</a>
46+
<a href="${rootURL}${i.url.startsWith('/') ? '' : '/'}${i.url}">${i.path}</a>
4747
</li>
4848
</j:forEach>
4949
</ol>

0 commit comments

Comments
 (0)