On Fri, 14 Dec 2012, Taner Topal wrote:

> Hey everyone,
> 
> is there a way to add some additional entries into the response headers of 
> the jenkins API calls?
> 
> I am trying to get some data from jenkins via AJAX/JSON/Jenkins JSON API.
> 
> My Jenkins is secured so I need to use Basic Authentication which wont work 
> because I am using JSONP. If I use JSON I could use Basic Auth but then I 
> get a CORS error...
> So I need to modify the reponse headers and add 
> Access-Control-Allow-Origin: *
> How to do that?


I think you have two options here, one is to write a plugin that adds the
headers and the other would be to run Jenkins with Tomcat or behind Apache's
mod_proxy.

The benefit of the latter is that I believe you can configure additional
headers to be served fairly easily, but I'm afraid I don't have any good
references on hand to do that.

- R. Tyler Croy
--------------------------------------
    Code: https://github.com/rtyler
 Chatter: https://twitter.com/agentdero

Attachment: signature.asc
Description: Digital signature

Reply via email to