Commit ca244c5d by Ryan Baxter Committed by GitHub

Merge pull request #1637 from tmack8001/zuul-route-constructor-custom-sensitive-headers

ZuulProperties.ZuulRoute consturctor missing explicitly setting of customSensitiveHeaders boolean
parents 5d0b2fae ff0ac568
......@@ -249,6 +249,7 @@ public class ZuulProperties {
this.stripPrefix = stripPrefix;
this.retryable = retryable;
this.sensitiveHeaders = sensitiveHeaders;
this.customSensitiveHeaders = sensitiveHeaders != null;
}
public ZuulRoute(String text) {
......
......@@ -72,6 +72,7 @@ public class ZuulPropertiesTests {
assertTrue(this.zuul.getRoutes().get("foo").getSensitiveHeaders().isEmpty());
assertTrue(this.zuul.getSensitiveHeaders()
.containsAll(Arrays.asList("Cookie", "Set-Cookie", "Authorization")));
assertFalse(route.isCustomSensitiveHeaders());
}
@Test
......@@ -83,6 +84,21 @@ public class ZuulPropertiesTests {
ZuulRoute foo = this.zuul.getRoutes().get("foo");
assertTrue(foo.getSensitiveHeaders().contains("x-foo"));
assertFalse(foo.getSensitiveHeaders().contains("Cookie"));
assertTrue(foo.isCustomSensitiveHeaders());
assertTrue(this.zuul.getSensitiveHeaders().contains("x-bar"));
assertFalse(this.zuul.getSensitiveHeaders().contains("Cookie"));
}
@Test
public void createWithSensitiveHeaders() {
this.zuul.setSensitiveHeaders(Collections.singleton("x-bar"));
ZuulRoute route = new ZuulRoute("foo", "/path", "foo", "/path",
false, false, Collections.singleton("x-foo"));
this.zuul.getRoutes().put("foo", route);
ZuulRoute foo = this.zuul.getRoutes().get("foo");
assertTrue(foo.getSensitiveHeaders().contains("x-foo"));
assertFalse(foo.getSensitiveHeaders().contains("Cookie"));
assertTrue(foo.isCustomSensitiveHeaders());
assertTrue(this.zuul.getSensitiveHeaders().contains("x-bar"));
assertFalse(this.zuul.getSensitiveHeaders().contains("Cookie"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment