MCPcopy
hub / github.com/gotify/server / tokenFromQueryOrHeader

Method tokenFromQueryOrHeader

auth/authentication.go:98–107  ·  view source on GitHub ↗
(ctx *gin.Context)

Source from the content-addressed store, hash-verified

96}
97
98func (a *Auth) tokenFromQueryOrHeader(ctx *gin.Context) string {
99 if token := a.tokenFromQuery(ctx); token != "" {
100 return token
101 } else if token := a.tokenFromXGotifyHeader(ctx); token != "" {
102 return token
103 } else if token := a.tokenFromAuthorizationHeader(ctx); token != "" {
104 return token
105 }
106 return ""
107}
108
109func (a *Auth) tokenFromQuery(ctx *gin.Context) string {
110 return ctx.Request.URL.Query().Get("token")

Callers 2

requireTokenMethod · 0.95
OptionalMethod · 0.95

Calls 3

tokenFromQueryMethod · 0.95

Tested by

no test coverage detected