f
This commit is contained in:
@@ -3,6 +3,7 @@ package middleware
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -12,7 +13,7 @@ const (
|
||||
func GlobalSourceInterceptor(next http.HandlerFunc) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
// 获取请求头 X-Platform 的值
|
||||
platform := r.Header.Get(PlatformKey)
|
||||
platform := strings.TrimSpace(r.Header.Get(PlatformKey))
|
||||
|
||||
// 将值放入新的 context 中
|
||||
ctx := r.Context()
|
||||
|
||||
Reference in New Issue
Block a user