forked from TrueCloudLab/frostfs-s3-gw
[#672] Support wildcard in allowed origins and headers
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
parent
2ad2531d3a
commit
e45c1a2188
6 changed files with 724 additions and 18 deletions
|
@ -290,6 +290,8 @@ const (
|
|||
//CORS configuration errors.
|
||||
ErrCORSUnsupportedMethod
|
||||
ErrCORSWildcardExposeHeaders
|
||||
ErrCORSWildcardsAllowedOrigins
|
||||
ErrCORSWildcardsAllowedHeaders
|
||||
|
||||
// Limits errors.
|
||||
ErrLimitExceeded
|
||||
|
@ -1740,7 +1742,7 @@ var errorCodes = errorCodeMap{
|
|||
ErrCORSWildcardExposeHeaders: {
|
||||
ErrCode: ErrCORSWildcardExposeHeaders,
|
||||
Code: "InvalidRequest",
|
||||
Description: "ExposeHeader \"*\" contains wildcard. We currently do not support wildcard for ExposeHeader",
|
||||
Description: "ExposeHeader contains wildcard. We currently do not support wildcard for ExposeHeader",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
ErrInvalidPartNumber: {
|
||||
|
@ -1781,6 +1783,18 @@ var errorCodes = errorCodeMap{
|
|||
Description: "The TagSet does not exist",
|
||||
HTTPStatusCode: http.StatusNotFound,
|
||||
},
|
||||
ErrCORSWildcardsAllowedOrigins: {
|
||||
ErrCode: ErrCORSWildcardsAllowedOrigins,
|
||||
Code: "InvalidRequest",
|
||||
Description: "AllowedOrigin can not have more than one wildcard.",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
ErrCORSWildcardsAllowedHeaders: {
|
||||
ErrCode: ErrCORSWildcardsAllowedHeaders,
|
||||
Code: "InvalidRequest",
|
||||
Description: "AllowedHeader can not have more than one wildcard.",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
// Add your error structure here.
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue