Use constant time comparison for WHIP tokens.
Thanks to Vinayak Mishra.
This commit is contained in:
+1
-1
@@ -295,7 +295,7 @@ func whipResourceHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if t := c.Token(); t != "" {
|
||||
token := parseBearerToken(r.Header.Get("Authorization"))
|
||||
if token != t {
|
||||
if !group.ConstantTimeCompare(t, token) {
|
||||
http.Error(w, "Forbidden", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user