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
80206e6b
Commit
80206e6b
authored
Jun 22, 2015
by
Brandon Atkinson
Committed by
Spencer Gibb
Jun 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed deflate accept-encoding from outbound requests
parent
58284a45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
ProxyRequestHelper.java
...mework/cloud/netflix/zuul/filters/ProxyRequestHelper.java
+1
-1
ProxyRequestHelperTests.java
...k/cloud/netflix/zuul/filters/ProxyRequestHelperTests.java
+18
-3
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/ProxyRequestHelper.java
View file @
80206e6b
...
@@ -93,7 +93,7 @@ public class ProxyRequestHelper {
...
@@ -93,7 +93,7 @@ public class ProxyRequestHelper {
for
(
String
header
:
zuulRequestHeaders
.
keySet
())
{
for
(
String
header
:
zuulRequestHeaders
.
keySet
())
{
headers
.
set
(
header
,
zuulRequestHeaders
.
get
(
header
));
headers
.
set
(
header
,
zuulRequestHeaders
.
get
(
header
));
}
}
headers
.
set
(
"accept-encoding"
,
"
deflate,
gzip"
);
headers
.
set
(
"accept-encoding"
,
"gzip"
);
return
headers
;
return
headers
;
}
}
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/ProxyRequestHelperTests.java
View file @
80206e6b
...
@@ -16,8 +16,6 @@
...
@@ -16,8 +16,6 @@
package
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
;
package
org
.
springframework
.
cloud
.
netflix
.
zuul
.
filters
;
import
java.util.List
;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.mockito.Mock
;
import
org.mockito.Mock
;
...
@@ -25,8 +23,10 @@ import org.springframework.boot.actuate.trace.TraceRepository;
...
@@ -25,8 +23,10 @@ import org.springframework.boot.actuate.trace.TraceRepository;
import
org.springframework.mock.web.MockHttpServletRequest
;
import
org.springframework.mock.web.MockHttpServletRequest
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
static
org
.
junit
.
Assert
.*;
import
java.util.List
;
import
static
org
.
hamcrest
.
Matchers
.*;
import
static
org
.
hamcrest
.
Matchers
.*;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
org
.
mockito
.
MockitoAnnotations
.
initMocks
;
import
static
org
.
mockito
.
MockitoAnnotations
.
initMocks
;
/**
/**
...
@@ -65,4 +65,19 @@ public class ProxyRequestHelperTests {
...
@@ -65,4 +65,19 @@ public class ProxyRequestHelperTests {
assertThat
(
missingName
,
is
(
nullValue
()));
assertThat
(
missingName
,
is
(
nullValue
()));
}
}
@Test
public
void
buildZuulRequestHeadersRequestsGzipAndOnlyGzip
()
{
MockHttpServletRequest
request
=
new
MockHttpServletRequest
(
""
,
"/"
);
ProxyRequestHelper
helper
=
new
ProxyRequestHelper
();
MultiValueMap
<
String
,
String
>
headers
=
helper
.
buildZuulRequestHeaders
(
request
);
List
<
String
>
acceptEncodings
=
headers
.
get
(
"accept-encoding"
);
assertThat
(
acceptEncodings
,
hasSize
(
1
));
assertThat
(
acceptEncodings
,
contains
(
"gzip"
));
}
}
}
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