(ctx *gin.Context)
| 96 | } |
| 97 | |
| 98 | func (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 | |
| 109 | func (a *Auth) tokenFromQuery(ctx *gin.Context) string { |
| 110 | return ctx.Request.URL.Query().Get("token") |
no test coverage detected