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
64cddf47
Commit
64cddf47
authored
Oct 15, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复ServerWebExchange为null的Bug
parent
4f318f1b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
discovery-plugin-strategy-starter-gateway/src/main/java/com/nepxion/discovery/plugin/strategy/gateway/adapter/DefaultDiscoveryEnabledAdapter.java
+15
-2
No files found.
discovery-plugin-strategy-starter-gateway/src/main/java/com/nepxion/discovery/plugin/strategy/gateway/adapter/DefaultDiscoveryEnabledAdapter.java
View file @
64cddf47
...
...
@@ -9,6 +9,8 @@ package com.nepxion.discovery.plugin.strategy.gateway.adapter;
* @version 1.0
*/
import
org.springframework.web.server.ServerWebExchange
;
import
com.nepxion.discovery.common.constant.DiscoveryConstant
;
import
com.nepxion.discovery.plugin.strategy.adapter.AbstractDiscoveryEnabledAdapter
;
import
com.nepxion.discovery.plugin.strategy.gateway.context.GatewayStrategyContext
;
...
...
@@ -18,13 +20,23 @@ public class DefaultDiscoveryEnabledAdapter extends AbstractDiscoveryEnabledAdap
protected
String
getVersionValue
()
{
GatewayStrategyContext
context
=
GatewayStrategyContext
.
getCurrentContext
();
return
context
.
getExchange
().
getRequest
().
getHeaders
().
getFirst
(
DiscoveryConstant
.
VERSION
);
ServerWebExchange
exchange
=
context
.
getExchange
();
if
(
exchange
==
null
)
{
return
null
;
}
return
exchange
.
getRequest
().
getHeaders
().
getFirst
(
DiscoveryConstant
.
VERSION
);
}
@Override
protected
String
getRegionValue
()
{
GatewayStrategyContext
context
=
GatewayStrategyContext
.
getCurrentContext
();
return
context
.
getExchange
().
getRequest
().
getHeaders
().
getFirst
(
DiscoveryConstant
.
REGION
);
ServerWebExchange
exchange
=
context
.
getExchange
();
if
(
exchange
==
null
)
{
return
null
;
}
return
exchange
.
getRequest
().
getHeaders
().
getFirst
(
DiscoveryConstant
.
REGION
);
}
}
\ No newline at end of file
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