File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,13 @@ import (
5
5
"net/http"
6
6
"strings"
7
7
8
- "github.com/labstack/echo/v4"
9
8
"github.com/webdevelop-pro/go-common/context/keys"
10
9
"github.com/webdevelop-pro/go-common/logger"
11
10
"github.com/webdevelop-pro/go-common/verser"
12
11
)
13
12
13
+ const HeaderXRequestID = "X-Request-Id"
14
+
14
15
func GetIPAddress (headers http.Header ) string {
15
16
ip := "127.0.0.1"
16
17
if xOFF := headers .Get ("X-Original-Forwarded-For" ); xOFF != "" {
@@ -54,7 +55,7 @@ func SetDefaultEventCtx(ctx context.Context, event Event) context.Context {
54
55
func SetDefaultWebhookCtx (ctx context.Context , webhook Webhook ) context.Context {
55
56
headers := http .Header (webhook .Headers )
56
57
57
- requestID := headers .Get (echo . HeaderXRequestID )
58
+ requestID := headers .Get (HeaderXRequestID )
58
59
IP := GetIPAddress (headers )
59
60
60
61
ctx = keys .SetCtxValue (ctx , keys .RequestID , requestID )
You can’t perform that action at this time.
0 commit comments