Commit fdaf040f authored by leitao.zhang's avatar leitao.zhang

把申请服务的用户ID和申请的服务ID传过给请求的服务

parent ea93cbf9
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/spf13/cast"
"github.com/vulcand/oxy/forward" "github.com/vulcand/oxy/forward"
"github.com/vulcand/oxy/testutils" "github.com/vulcand/oxy/testutils"
"gitlab.wodcloud.com/apaas/apaas-meshproxy/src/model" "gitlab.wodcloud.com/apaas/apaas-meshproxy/src/model"
...@@ -173,6 +174,10 @@ func Proxy(c *gin.Context) { ...@@ -173,6 +174,10 @@ func Proxy(c *gin.Context) {
c.Request.RequestURI = reqURL.RequestURI() c.Request.RequestURI = reqURL.RequestURI()
fmt.Println("c.Request-------", c.Request) fmt.Println("c.Request-------", c.Request)
c.Request.Host = getHost(proxyData.ReqUrl) c.Request.Host = getHost(proxyData.ReqUrl)
//发送服务ID和用户ID
c.Request.Header.Set("applyuserid", proxyData.ApplyUserId)
c.Request.Header.Set("applyserviceid", cast.ToString(proxyData.ServiceId))
fmt.Println("proxyData.RealUrl-------", proxyData.ReqUrl) fmt.Println("proxyData.RealUrl-------", proxyData.ReqUrl)
forwarder.ServeHTTP(c.Writer, c.Request) forwarder.ServeHTTP(c.Writer, c.Request)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment