Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
ca244c5d
Commit
ca244c5d
authored
Jan 23, 2017
by
Ryan Baxter
Committed by
GitHub
Jan 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1637 from tmack8001/zuul-route-constructor-custom-sensitive-headers
ZuulProperties.ZuulRoute consturctor missing explicitly setting of customSensitiveHeaders boolean
parents
5d0b2fae
ff0ac568
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
ZuulProperties.java
...gframework/cloud/netflix/zuul/filters/ZuulProperties.java
+1
-0
ZuulPropertiesTests.java
...ework/cloud/netflix/zuul/filters/ZuulPropertiesTests.java
+16
-0
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/ZuulProperties.java
View file @
ca244c5d
...
...
@@ -249,6 +249,7 @@ public class ZuulProperties {
this
.
stripPrefix
=
stripPrefix
;
this
.
retryable
=
retryable
;
this
.
sensitiveHeaders
=
sensitiveHeaders
;
this
.
customSensitiveHeaders
=
sensitiveHeaders
!=
null
;
}
public
ZuulRoute
(
String
text
)
{
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/ZuulPropertiesTests.java
View file @
ca244c5d
...
...
@@ -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"
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment