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
e2e7c490
Commit
e2e7c490
authored
Aug 17, 2016
by
Ryan Baxter
Committed by
GitHub
Aug 17, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1247 from Coramo/master
fix 'RibbonRequest' cannot to encode issues
parents
68cf3460
2db2a033
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
FeignLoadBalancer.java
...amework/cloud/netflix/feign/ribbon/FeignLoadBalancer.java
+1
-3
FeignLoadBalancerTests.java
...rk/cloud/netflix/feign/ribbon/FeignLoadBalancerTests.java
+18
-0
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/ribbon/FeignLoadBalancer.java
View file @
e2e7c490
...
...
@@ -123,9 +123,7 @@ public class FeignLoadBalancer extends
request
.
headers
());
// Apache client barfs if you set the content length
headers
.
remove
(
Util
.
CONTENT_LENGTH
);
return
new
RequestTemplate
().
method
(
request
.
method
())
.
append
(
getUri
().
toASCIIString
())
.
body
(
request
.
body
(),
request
.
charset
()).
headers
(
headers
).
request
();
return
Request
.
create
(
request
.
method
(),
getUri
().
toASCIIString
(),
headers
,
request
.
body
(),
request
.
charset
());
}
Request
toRequest
()
{
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/feign/ribbon/FeignLoadBalancerTests.java
View file @
e2e7c490
...
...
@@ -18,6 +18,7 @@ import static org.mockito.Mockito.when;
import
java.net.URI
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -113,4 +114,21 @@ public class FeignLoadBalancerTests {
new
URI
(
"http://bar/"
));
assertThat
(
uri
,
is
(
new
URI
(
"https://foo:443/"
)));
}
@Test
@SneakyThrows
public
void
testRibbonRequestURLEncode
()
{
String
url
=
"http://foo/?name=%7bcookie"
;
//name={cookie
Request
request
=
Request
.
create
(
"GET"
,
url
,
new
HashMap
(),
null
,
null
);
assertThat
(
request
.
url
(),
is
(
url
));
RibbonRequest
ribbonRequest
=
new
RibbonRequest
(
this
.
delegate
,
request
,
new
URI
(
request
.
url
()));
Request
cloneRequest
=
ribbonRequest
.
toRequest
();
assertThat
(
cloneRequest
.
url
(),
is
(
url
));
}
}
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