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
b1ec12af
Commit
b1ec12af
authored
Aug 03, 2016
by
Stéphane Lagraulet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a check to current context as contentLength is already in the context
parent
7929dfec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
AbstractRibbonCommand.java
...lix/zuul/filters/route/support/AbstractRibbonCommand.java
+11
-7
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/route/support/AbstractRibbonCommand.java
View file @
b1ec12af
...
...
@@ -46,18 +46,20 @@ public abstract class AbstractRibbonCommand<LBC extends AbstractLoadBalancerAwar
protected
final
LBC
client
;
protected
RibbonCommandContext
context
;
public
AbstractRibbonCommand
(
LBC
client
,
RibbonCommandContext
context
,
ZuulProperties
zuulProperties
)
{
public
AbstractRibbonCommand
(
LBC
client
,
RibbonCommandContext
context
,
ZuulProperties
zuulProperties
)
{
this
(
"default"
,
client
,
context
,
zuulProperties
);
}
public
AbstractRibbonCommand
(
String
commandKey
,
LBC
client
,
RibbonCommandContext
context
,
ZuulProperties
zuulProperties
)
{
public
AbstractRibbonCommand
(
String
commandKey
,
LBC
client
,
RibbonCommandContext
context
,
ZuulProperties
zuulProperties
)
{
super
(
getSetter
(
commandKey
,
zuulProperties
));
this
.
client
=
client
;
this
.
context
=
context
;
}
protected
static
Setter
getSetter
(
final
String
commandKey
,
ZuulProperties
zuulProperties
)
{
protected
static
Setter
getSetter
(
final
String
commandKey
,
ZuulProperties
zuulProperties
)
{
// @formatter:off
final
HystrixCommandProperties
.
Setter
setter
=
HystrixCommandProperties
.
Setter
()
...
...
@@ -82,9 +84,11 @@ public abstract class AbstractRibbonCommand<LBC extends AbstractLoadBalancerAwar
@Override
protected
ClientHttpResponse
run
()
throws
Exception
{
final
RequestContext
context
=
RequestContext
.
getCurrentContext
();
String
contentLengthHeader
=
context
.
getRequest
().
getHeader
(
"Content-Length"
);
if
(
StringUtils
.
hasText
(
contentLengthHeader
))
{
this
.
context
.
setContentLength
(
new
Long
(
contentLengthHeader
));
if
(
context
.
getRequest
()
!=
null
)
{
String
contentLengthHeader
=
context
.
getRequest
().
getHeader
(
"Content-Length"
);
if
(
StringUtils
.
hasText
(
contentLengthHeader
))
{
this
.
context
.
setContentLength
(
new
Long
(
contentLengthHeader
));
}
}
RQ
request
=
createRequest
();
...
...
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