提交 0422d28d authored 作者: mooncake9527's avatar mooncake9527

header fields

上级 8679333b
...@@ -113,7 +113,7 @@ func show(obj ILock, fields ...string) string { ...@@ -113,7 +113,7 @@ func show(obj ILock, fields ...string) string {
if err != nil { if err != nil {
break break
} }
fields = append(fields, `“SignKey”`, `"dsn"`, `"password"`, `"pwd"`, `"signKey"`, `"access-key-id"`, `"access-key-secret"`) fields = append(fields, `“SignKey”`, `"dsn"`, `"password"`, `"pwd"`, `"signKey"`, `"access-key-id"`, `"access-key-secret"`, `"app-secret"`, `"smtpPassword"`)
out += HideSensitiveFields(line, fields...) out += HideSensitiveFields(line, fields...)
} }
return out return out
......
...@@ -110,7 +110,7 @@ func Auth(opts ...JwtOption) gin.HandlerFunc { ...@@ -110,7 +110,7 @@ func Auth(opts ...JwtOption) gin.HandlerFunc {
} }
} }
func JwtFields() gin.HandlerFunc { func URLFields() gin.HandlerFunc {
return func(c *gin.Context) { return func(c *gin.Context) {
params := c.Request.URL.Query() params := c.Request.URL.Query()
for key, values := range params { for key, values := range params {
...@@ -121,6 +121,14 @@ func JwtFields() gin.HandlerFunc { ...@@ -121,6 +121,14 @@ func JwtFields() gin.HandlerFunc {
} }
} }
func HeaderFields(keys []string) gin.HandlerFunc {
return func(c *gin.Context) {
for _, key := range keys {
c.Set(key, c.Request.Header.Get(key))
}
}
}
// ------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------
// VerifyCustomFn verify custom function, tokenTail10 is the last 10 characters of the token. // VerifyCustomFn verify custom function, tokenTail10 is the last 10 characters of the token.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论