Our builds generate a webpage which allows the end-user to more easily
launch a new build based on the original build. Here's an example:
<head>
<title>Build Links</title>
<script>
function runNewBuild()
{
xmlhttp= new XMLHttpRequest();
xmlhttp.open("POST",
"/view/MyView/job/MyJob/buildWithParameters?Parm1=Razz&Parm2=Zazz");
xmlhttp.send()
}
</script>
</head>
<form onsubmit="return false;">
<button onClick="runNewBuild()">Run New Build</button>
</form>
The html file is stored in and accessed from the build workspace. E.g. the
url is:
https://jenkins.myCompany.com:8081/job/MyJob/ws/SomeDir/build_links.html
This worked fine in 1.9, but now fails after upgrading. I fixed some of the
issues by setting:
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP","sandbox
allow-forms allow-scripts;")
But I still get (using chrome inspector):
XMLHttpRequest cannot load
https://jenkins.myCompany.com:8081/view/MyView/job/MyJob/buildWithParameters?Parm1=Razz&Parm2=Zazz.
No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'null' is therefore not allowed access. The response had
HTTP status code 403.
Can anyone provide into any guidance? Googling tends to bring up stuff
related to CORS, but unless I'm missing something...this should not be
cross origin.
Thanks in advance,
Rob Conde
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/6147e5cb-a8c7-487c-ab56-0eba3425a3ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.