Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈文顺
discovery
Commits
942fae37
Commit
942fae37
authored
May 08, 2019
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加从Zuul Filter获取Header的方式
parent
3673028b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
discovery-springcloud-example-zuul/src/main/java/com/nepxion/discovery/plugin/example/zuul/impl/MyDiscoveryEnabledStrategy.java
+5
-0
No files found.
discovery-springcloud-example-zuul/src/main/java/com/nepxion/discovery/plugin/example/zuul/impl/MyDiscoveryEnabledStrategy.java
View file @
942fae37
...
...
@@ -46,7 +46,12 @@ public class MyDiscoveryEnabledStrategy implements DiscoveryEnabledStrategy {
return
true
;
}
// 来自于外界的Header,例如,从Postman传递过来的Header
String
token
=
request
.
getHeader
(
"token"
);
if
(
StringUtils
.
isEmpty
(
token
))
{
// 来自于Zuul Filter的Header
token
=
zuulStrategyContextHolder
.
getZuulRequestHeaders
().
get
(
"token"
);
}
// String value = request.getParameter("value");
String
serviceId
=
pluginAdapter
.
getServerServiceId
(
server
);
...
...
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