mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-10-10 04:53:09 +08:00
chore: standardize context keys with custom ContextKey type (#697)
* chore: standardize context keys with custom ContextKey type * fix bug * 使用Request.Context
This commit is contained in:
+14
-2
@@ -149,7 +149,19 @@ const (
|
||||
)
|
||||
|
||||
// ContextKey is the type of context keys.
|
||||
type ContextKey int
|
||||
|
||||
const (
|
||||
NoTaskKey = "no_task"
|
||||
ApiUrlKey = "api_url"
|
||||
_ ContextKey = iota
|
||||
|
||||
NoTaskKey
|
||||
ApiUrlKey
|
||||
UserKey
|
||||
MetaKey
|
||||
MetaPassKey
|
||||
ClientIPKey
|
||||
ProxyHeaderKey
|
||||
RequestHeaderKey
|
||||
UserAgentKey
|
||||
PathKey
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user