mirror of
https://github.com/zitadel/zitadel.git
synced 2025-05-30 21:18:21 +00:00
fix: allow scim content type wildcards (#9245)
# Which Problems Are Solved - requests to the scim interface with content type `*/*` are rejected # How the Problems Are Solved - `*/*` is accepted as content type # Additional Context Part of #8140
This commit is contained in:
parent
741434806a
commit
b19333726c
@ -13,8 +13,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ContentTypeScim = "application/scim+json"
|
ContentTypeScim = "application/scim+json"
|
||||||
ContentTypeJson = "application/json"
|
ContentTypeJson = "application/json"
|
||||||
|
ContentTypeApplicationWildcard = "application/*"
|
||||||
|
ContentTypeWildcard = "*/*"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ContentTypeMiddleware(next middleware.HandlerFuncWithError) middleware.HandlerFuncWithError {
|
func ContentTypeMiddleware(next middleware.HandlerFuncWithError) middleware.HandlerFuncWithError {
|
||||||
@ -44,7 +46,11 @@ func validateContentType(contentType string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if mediaType != "" && !strings.EqualFold(mediaType, ContentTypeJson) && !strings.EqualFold(mediaType, ContentTypeScim) {
|
if mediaType != "" &&
|
||||||
|
!strings.EqualFold(mediaType, ContentTypeWildcard) &&
|
||||||
|
!strings.EqualFold(mediaType, ContentTypeApplicationWildcard) &&
|
||||||
|
!strings.EqualFold(mediaType, ContentTypeJson) &&
|
||||||
|
!strings.EqualFold(mediaType, ContentTypeScim) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user