+
+
+
diff --git a/src/main/resources/org/jenkinsci/plugins/corsfilter/AccessControlsFilter/help-allowedHeaders.html b/src/main/resources/org/jenkinsci/plugins/corsfilter/AccessControlsFilter/help-allowedHeaders.html
new file mode 100644
index 0000000..7407bce
--- /dev/null
+++ b/src/main/resources/org/jenkinsci/plugins/corsfilter/AccessControlsFilter/help-allowedHeaders.html
@@ -0,0 +1,6 @@
+
+ Specifies the header or headers allowed when accessing the Jenkins resources. This is used in response to a pre-flight
+ request containing Access-Control-Request-Headers
+
+ For example: Content-Type
+
diff --git a/src/test/java/org/jenkinsci/plugins/corsfilter/AccessControlsFilterTest.java b/src/test/java/org/jenkinsci/plugins/corsfilter/AccessControlsFilterTest.java
index 721f22b..059aae2 100644
--- a/src/test/java/org/jenkinsci/plugins/corsfilter/AccessControlsFilterTest.java
+++ b/src/test/java/org/jenkinsci/plugins/corsfilter/AccessControlsFilterTest.java
@@ -62,4 +62,19 @@ public void testAllowOrigins() throws Exception {
assertEquals(htmlPage.getWebResponse().getResponseHeaderValue("Access-Control-Allow-Origin"), "http://localhost:9000");
}
+ @Test
+ public void testAllowHeaders() throws Exception {
+ descriptor.setAllowedMethods("GET, OPTIONS");
+ descriptor.setAllowedOrigins("http://localhost:9000, http://localhost:8080");
+ descriptor.setAllowedHeaders("Origin, Content-Type, X-Foo");
+ descriptor.setEnabled(true);
+
+ client.addRequestHeader("Origin", "http://localhost:9000");
+ client.addRequestHeader("Access-Control-Request-Headers", "Content-Type");
+ HtmlPage htmlPage = client.goTo("");
+
+ assertTrue(Boolean.valueOf(htmlPage.getWebResponse().getResponseHeaderValue("Access-Control-Allow-Credentials")));
+ assertEquals(htmlPage.getWebResponse().getResponseHeaderValue("Access-Control-Allow-Headers"), "Content-Type");
+ }
+
}
\ No newline at end of file