Skip to content

Commit 0c1e849

Browse files
committed
removed echo dependency from queue
1 parent 8cb2bad commit 0c1e849

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

queue/pclient/utils.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import (
55
"net/http"
66
"strings"
77

8-
"github.com/labstack/echo/v4"
98
"github.com/webdevelop-pro/go-common/context/keys"
109
"github.com/webdevelop-pro/go-common/logger"
1110
"github.com/webdevelop-pro/go-common/verser"
1211
)
1312

13+
const HeaderXRequestID = "X-Request-Id"
14+
1415
func GetIPAddress(headers http.Header) string {
1516
ip := "127.0.0.1"
1617
if xOFF := headers.Get("X-Original-Forwarded-For"); xOFF != "" {
@@ -54,7 +55,7 @@ func SetDefaultEventCtx(ctx context.Context, event Event) context.Context {
5455
func SetDefaultWebhookCtx(ctx context.Context, webhook Webhook) context.Context {
5556
headers := http.Header(webhook.Headers)
5657

57-
requestID := headers.Get(echo.HeaderXRequestID)
58+
requestID := headers.Get(HeaderXRequestID)
5859
IP := GetIPAddress(headers)
5960

6061
ctx = keys.SetCtxValue(ctx, keys.RequestID, requestID)

0 commit comments

Comments
 (0)