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
ad86d48c
Commit
ad86d48c
authored
Aug 25, 2015
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use HttpHeaders for headers (case insensitive)
Fixes gh-306
parent
2c688062
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
ProxyRequestHelper.java
...mework/cloud/netflix/zuul/filters/ProxyRequestHelper.java
+12
-10
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/ProxyRequestHelper.java
View file @
ad86d48c
...
...
@@ -30,16 +30,18 @@ import java.util.Set;
import
javax.servlet.http.HttpServletRequest
;
import
lombok.extern.apachecommons.CommonsLog
;
import
org.apache.commons.io.IOUtils
;
import
org.springframework.boot.actuate.trace.TraceRepository
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.util.UriUtils
;
import
org.springframework.web.util.WebUtils
;
import
com.netflix.zuul.context.RequestContext
;
import
com.netflix.zuul.util.HTTPRequestUtils
;
import
org.springframework.web.util.UriUtils
;
import
org.springframework.web.util.WebUtils
;
/**
* @author Dave Syer
...
...
@@ -93,17 +95,17 @@ public class ProxyRequestHelper {
public
MultiValueMap
<
String
,
String
>
buildZuulRequestHeaders
(
HttpServletRequest
request
)
{
RequestContext
context
=
RequestContext
.
getCurrentContext
();
MultiValueMap
<
String
,
String
>
headers
=
new
LinkedMultiValueMap
<>
();
MultiValueMap
<
String
,
String
>
headers
=
new
HttpHeaders
();
Enumeration
<
String
>
headerNames
=
request
.
getHeaderNames
();
if
(
headerNames
!=
null
)
{
while
(
headerNames
.
hasMoreElements
())
{
String
name
=
headerNames
.
nextElement
();
if
(
isIncludedHeader
(
name
))
{
Enumeration
<
String
>
values
=
request
.
getHeaders
(
name
);
while
(
values
.
hasMoreElements
())
{
String
value
=
values
.
nextElement
();
headers
.
add
(
name
,
value
);
}
if
(
isIncludedHeader
(
name
))
{
Enumeration
<
String
>
values
=
request
.
getHeaders
(
name
);
while
(
values
.
hasMoreElements
())
{
String
value
=
values
.
nextElement
();
headers
.
add
(
name
,
value
);
}
}
}
}
...
...
@@ -111,7 +113,7 @@ public class ProxyRequestHelper {
for
(
String
header
:
zuulRequestHeaders
.
keySet
())
{
headers
.
set
(
header
,
zuulRequestHeaders
.
get
(
header
));
}
headers
.
set
(
"accept-encoding"
,
"gzip"
);
headers
.
set
(
HttpHeaders
.
ACCEPT_ENCODING
,
"gzip"
);
return
headers
;
}
...
...
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