Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-meshproxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-meshproxy
Commits
fdaf040f
You need to sign in or sign up before continuing.
Commit
fdaf040f
authored
Dec 28, 2020
by
leitao.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
把申请服务的用户ID和申请的服务ID传过给请求的服务
parent
ea93cbf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
src/handler/proxyhandler.go
src/handler/proxyhandler.go
+5
-0
No files found.
src/handler/proxyhandler.go
View file @
fdaf040f
...
...
@@ -8,6 +8,7 @@ import (
"errors"
"fmt"
"github.com/gin-gonic/gin"
"github.com/spf13/cast"
"github.com/vulcand/oxy/forward"
"github.com/vulcand/oxy/testutils"
"gitlab.wodcloud.com/apaas/apaas-meshproxy/src/model"
...
...
@@ -173,6 +174,10 @@ func Proxy(c *gin.Context) {
c
.
Request
.
RequestURI
=
reqURL
.
RequestURI
()
fmt
.
Println
(
"c.Request-------"
,
c
.
Request
)
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
)
forwarder
.
ServeHTTP
(
c
.
Writer
,
c
.
Request
)
}
...
...
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