-
-
Notifications
You must be signed in to change notification settings - Fork 9k
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
[JENKINS-71726] [JENKINS-71727] remove inline javascript #8313
Conversation
Also JENKINS-71726
Thanks for this PR @mawinter69, I'll try to review it as soon as possible. |
From a security perspective, this is fine. However, I've noticed some latency during each redirection, which, if I'm correct, wasn't present previously. For example, when I try to access my job without being authenticated, it doesn't redirect me to the login form instantly but displays a blank page for longer than usual. I think, the timing difference is related to the time it takes to load the Perhaps we could choose a different CSP approval approach, using nonce or hash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I investigated further as to why I was experiencing this delay, and found that it was simply because the script wasn't being executed. The delay I was encountering was due to the redirection initiated by the meta refresh tag, which has a delay set to 1 second (content='1
).
Upon closer look on what happened, the rendered page was:
The script tag is malformed, taking the remainder of our request.
I'm not sure why, but the self-closing tag isn't functioning correctly. Closing it with a full tag resolves this issue.
Co-authored-by: Kevin Guerroudj <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I retested it with your change, and it works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested with this change applied to the master branch and it works well in my testing also.
This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback.
/label ready-for-merge
See JENKINS-71727.
See JENKINS-71726.
Testing done
JENKINS-71727:
curl -u http://jenkins/job/test/
and checked output contains data-redirect-url to loginform and javascript src points to proper script url.Authentication required
is included in the outputJENKINS-71726:
Previous Build
curl -u user:token http://jenkins/job/test/1/parameters/
and checked output contains data-redirect-url and javascript src points to proper script url.Not found
is included in the outputProposed changelog entries
N/A
Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
N/A
Before the changes are marked as
ready-for-merge
:Maintainer checklist