Skip to content

jenkinsci/cors-filter-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CORS Filter

This plugin supports cross-site http requests to Jenkins

Setup

  1. Install this plugin from the Jenkins Update center
  2. From system configuration page, add cross-site domain's you'd like to allow to request Jenkins resources
  3. Add supported methods (GET, PUT, OPTIONS, POST) etc...
  4. Enable - Convenient method to enable/disable CORS filter without having to delete the settings for future use.
  5. Save

Request / Response examples

###Simple GET Request/response

GET /api HTTP/1.1
Origin: http://foo.example
Host: bar.other

HTTP/1.1 200 OK
Date: Mon, 01 Jan 2015 00:23:53 GMT
Server: Apache/2.0.61 
Access-Control-Allow-Origin: http://foo.example

[some data]

###Non-GET (or POST,PUT etc...) methods

OPTIONS /api/json HTTP/1.1
Host: bar.other
Origin: http://foo.example
Access-Control-Request-Method: POST
Access-Control-Request-Headers: X-PINGOTHER

HTTP/1.1 200 OK
Access-Control-Allow-Origin: http://foo.example
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: X-PINGOTHER
Access-Control-Max-Age: 1728000

POST /api/json HTTP/1.1
Host: bar.other
X-PINGOTHER: pingpong
Content-Type: text/json; charset=UTF-8
Referer: http://foo.example/getJobs.html
Origin: http://foo.example

[some data here]

HTTP/1.1 200 OK
Access-Control-Allow-Origin: http://foo.example
Content-Type: text/json

{some json data here}

About

Plugin to support Cross-site HTTP requests on Jenkins

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 89.0%
  • HTML 11.0%