Commit c5d401d
sahilleth
Fix newView link to use context-relative URL instead of rootURL
Fixes JENKINS-51291 / #22743
When Jenkins is behind a reverse proxy (e.g. nginx), the Jenkins Root URL
may be configured to the internal server URL for agent connectivity.
The 'New View' link in the view tab bar was using rootURL, causing it to
navigate to the internal URL instead of the proxy URL.
Use request.contextPath + owner.url instead of rootURL so the link
resolves relative to the current origin (proxy URL), while still
correctly targeting the owning ViewGroup's newView action for both
root, folders, and My Views. This also fixes SECURITY-1471 by removing
rootURL from the link, preventing javascript: injection via Root URL.
Made-with: Cursor1 parent 057aa6a commit c5d401d
File tree
2 files changed
+3
-3
lines changed- core/src/main/resources/hudson/views
- DefaultMyViewsTabBar
- DefaultViewsTabBar
2 files changed
+3
-3
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
0 commit comments