You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Fetch standard states that methods are, in general, case-sensitive. For instance, PATCH is distinct from patch.
However, Gin's CORS middleware currently uppercases the allowed methods before writing the result in the Access-Control-Allow-Methods. Therefore, Gin's CORS middleware prevents its users from allowing methods that are not already uppercase.
The Fetch standard states that methods are, in general, case-sensitive. For instance,
PATCH
is distinct frompatch
.However, Gin's CORS middleware currently uppercases the allowed methods before writing the result in the
Access-Control-Allow-Methods
. Therefore, Gin's CORS middleware prevents its users from allowing methods that are not already uppercase.Accordingly, two currently passing test cases,
TestGeneratePreflightHeaders_AllowMethods
andTestPassesAllowOrigins
, should actually fail, because their assertions onw.Header().Get("Access-Control-Allow-Methods")
are incorrect.FWIW, this undue case-normalisation can be deplored in other CORS middleware libraries and it tends to trip users up. Gin should fixed this.
The text was updated successfully, but these errors were encountered: