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
73b5609e
Commit
73b5609e
authored
May 15, 2017
by
Luke Tornquist
Committed by
Spencer Gibb
May 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow easier subclassing of SimpleRouteLocator
Fixes gh-1598
parent
fe06370a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
SimpleRouteLocator.java
...mework/cloud/netflix/zuul/filters/SimpleRouteLocator.java
+17
-10
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/SimpleRouteLocator.java
View file @
73b5609e
...
...
@@ -83,6 +83,11 @@ public class SimpleRouteLocator implements RouteLocator, Ordered {
@Override
public
Route
getMatchingRoute
(
final
String
path
)
{
return
getSimpleMatchingRoute
(
path
);
}
protected
Route
getSimpleMatchingRoute
(
final
String
path
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"Finding route for path: "
+
path
);
}
...
...
@@ -102,29 +107,31 @@ public class SimpleRouteLocator implements RouteLocator, Ordered {
String
adjustedPath
=
adjustPath
(
path
);
ZuulRoute
route
=
null
;
ZuulRoute
route
=
getZuulRoute
(
adjustedPath
);
return
getRoute
(
route
,
adjustedPath
);
}
protected
ZuulRoute
getZuulRoute
(
String
adjustedPath
)
{
if
(!
matchesIgnoredPatterns
(
adjustedPath
))
{
for
(
Entry
<
String
,
ZuulRoute
>
entry
:
this
.
routes
.
get
().
entrySet
())
{
String
pattern
=
entry
.
getKey
();
log
.
debug
(
"Matching pattern:"
+
pattern
);
if
(
this
.
pathMatcher
.
match
(
pattern
,
adjustedPath
))
{
route
=
entry
.
getValue
();
break
;
return
entry
.
getValue
();
}
}
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"route matched="
+
route
);
}
return
getRoute
(
route
,
adjustedPath
);
return
null
;
}
pr
ivate
Route
getRoute
(
ZuulRoute
route
,
String
path
)
{
pr
otected
Route
getRoute
(
ZuulRoute
route
,
String
path
)
{
if
(
route
==
null
)
{
return
null
;
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"route matched="
+
route
);
}
String
targetPath
=
path
;
String
prefix
=
this
.
properties
.
getPrefix
();
if
(
path
.
startsWith
(
prefix
)
&&
this
.
properties
.
isStripPrefix
())
{
...
...
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