KNOX-1310 - Handle custom param value for X-Content-Type-Options header
authorPhil Zampino <pzampino@apache.org>
Wed, 16 May 2018 03:13:55 +0000 (23:13 -0400)
committerPhil Zampino <pzampino@apache.org>
Wed, 16 May 2018 03:13:55 +0000 (23:13 -0400)
gateway-provider-security-webappsec/src/main/java/org/apache/knox/gateway/webappsec/filter/XContentTypeOptionsFilter.java
gateway-provider-security-webappsec/src/test/java/org/apache/knox/gateway/webappsec/XContentTypeOptionsFilterTest.java

index b05b335..301f8bb 100644 (file)
@@ -33,7 +33,7 @@ public class XContentTypeOptionsFilter implements Filter {
 
   public static final String X_CONTENT_TYPE_OPTIONS_HEADER = "X-Content-Type-Options";
 
-  public static final String CUSTOM_HEADER_PARAM = "xcontent-type.options";
+  public static final String CUSTOM_HEADER_PARAM = "xcontent-type.options.value";
 
   public static final String DEFAULT_OPTION_VALUE = "nosniff";
 
index e5fb587..98eff29 100644 (file)
@@ -76,7 +76,7 @@ public class XContentTypeOptionsFilterTest {
       XContentTypeOptionsFilter filter = new XContentTypeOptionsFilter();
       Properties props = new Properties();
       props.put("xcontent-type.options.enabled", "true");
-      props.put("xcontent-type.options", customOption);
+      props.put("xcontent-type.options.value", customOption);
       filter.init(new TestFilterConfig(props));
 
       HttpServletRequest request = EasyMock.createNiceMock(HttpServletRequest.class);