This is an automated email from the ASF dual-hosted git repository.

wujimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-samples.git


The following commit(s) were added to refs/heads/master by this push:
     new 135b17a  demo enable inspector and fix context error
135b17a is described below

commit 135b17a3b638839dd0f8a75d185318ca876ce2fd
Author: liubao <[email protected]>
AuthorDate: Fri Apr 19 14:58:04 2019 +0800

    demo enable inspector and fix context error
---
 .../apache/servicecomb/samples/porter/gateway/ApiDispatcher.java    | 6 +++---
 porter_lightweight/pom.xml                                          | 4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/porter_lightweight/gateway-service/src/main/java/org/apache/servicecomb/samples/porter/gateway/ApiDispatcher.java
 
b/porter_lightweight/gateway-service/src/main/java/org/apache/servicecomb/samples/porter/gateway/ApiDispatcher.java
index 3057c1f..e801ebd 100644
--- 
a/porter_lightweight/gateway-service/src/main/java/org/apache/servicecomb/samples/porter/gateway/ApiDispatcher.java
+++ 
b/porter_lightweight/gateway-service/src/main/java/org/apache/servicecomb/samples/porter/gateway/ApiDispatcher.java
@@ -47,9 +47,9 @@ public class ApiDispatcher extends AbstractEdgeDispatcher {
     String path = "/" + pathParams.get("param1");
 
     EdgeInvocation invoker = new EdgeInvocation() {
-      // Authentication
-      protected void createInvocation() {
-        super.createInvocation();
+      // Authentication. Notice: adding context must after setContext or will 
override by network
+      protected void setContext() throws Exception {
+        super.setContext();
         // get session id from header and cookie for debug reasons
         String sessionId = context.request().getHeader("session-id");
         if (sessionId != null) {
diff --git a/porter_lightweight/pom.xml b/porter_lightweight/pom.xml
index 08a5500..1892c79 100644
--- a/porter_lightweight/pom.xml
+++ b/porter_lightweight/pom.xml
@@ -62,6 +62,10 @@
       <groupId>org.apache.servicecomb</groupId>
       <artifactId>solution-basic</artifactId>
     </dependency>
+        <dependency>
+      <groupId>org.apache.servicecomb</groupId>
+      <artifactId>inspector</artifactId>
+    </dependency>
   </dependencies>
 
   <modules>

Reply via email to