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
52ab4d3e
Commit
52ab4d3e
authored
Feb 14, 2017
by
Ryan Baxter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds a check for an empty URI in updateToHttpsIfNeeded. Fixes #1690.
parent
d78da7b9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
RibbonUtils.java
...org/springframework/cloud/netflix/ribbon/RibbonUtils.java
+1
-1
RibbonUtilsTests.java
...pringframework/cloud/netflix/ribbon/RibbonUtilsTests.java
+8
-0
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonUtils.java
View file @
52ab4d3e
...
...
@@ -71,7 +71,7 @@ public class RibbonUtils {
public
static
URI
updateToHttpsIfNeeded
(
URI
uri
,
IClientConfig
config
,
ServerIntrospector
serverIntrospector
,
Server
server
)
{
String
scheme
=
uri
.
getScheme
();
if
(!
"https"
.
equals
(
scheme
)
&&
isSecure
(
config
,
serverIntrospector
,
server
))
{
if
(!
"
"
.
equals
(
uri
.
toString
())
&&
!
"
https"
.
equals
(
scheme
)
&&
isSecure
(
config
,
serverIntrospector
,
server
))
{
UriComponentsBuilder
uriComponentsBuilder
=
UriComponentsBuilder
.
fromUri
(
uri
).
scheme
(
"https"
);
if
(
uri
.
getRawQuery
()
!=
null
)
{
// When building the URI, UriComponentsBuilder verify the allowed characters and does not
...
...
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/ribbon/RibbonUtilsTests.java
View file @
52ab4d3e
...
...
@@ -110,6 +110,14 @@ public class RibbonUtilsTests {
"https://foo/%20bar?hello=1%202"
)));
}
@Test
public
void
emptyStringUri
()
throws
URISyntaxException
{
URI
original
=
new
URI
(
""
);
URI
updated
=
updateToHttpsIfNeeded
(
original
,
SECURE_CONFIG
,
SECURE_INTROSPECTOR
,
SERVER
);
Assert
.
assertThat
(
"URI should be the emptry string"
,
updated
,
is
(
new
URI
(
""
)));
}
static
DefaultClientConfigImpl
getConfig
(
boolean
value
)
{
DefaultClientConfigImpl
config
=
new
DefaultClientConfigImpl
();
config
.
setProperty
(
CommonClientConfigKey
.
IsSecure
,
value
);
...
...
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