1

I try to write a SonarQube widget plugin which accesses Jenkins build information by jsonp(json with padding).

This is my html file:

<p id="id"></p>
<script type="text/javascript">
function display(data){
 document.getElementById("id").innerHTML = data.number;
}

</script>
<script type="application/javascript" src="http://MYHOST/job/MYJOB/lastBuild/api/json?jsonp=display"> </script>

the html is running fine on my localhost.

But when the html built as a widget plugin in my sonarqube server, the jsonp get error.

Failed to load resource: the server responded with a status of 403 (jsonp forbidden; implement jenkins.security.SecureRequester)

My SonarQube version is 5.6.

Is there any sonarqube web security policy I didn't get it?

Poyee
  • 83
  • 7
  • it does not seem to be a problem on SonarQube side but on Jenkins side. – Simon Brandhof Aug 31 '16 at 17:54
  • I have allowed jsonp request on my Jenkins server. The html work fine on my localhost, even on this website if I use the right url. But the html can't work when it became a widget plugin in SonarQube. – Poyee Sep 01 '16 at 00:50

0 Answers0