mirror of
https://github.com/ceph/ceph
synced 2025-02-22 02:27:29 +00:00
Merge pull request #23626 from Liuchang0812/rgw-put-cors-compatible
rgw: return err_malformed_xml when MaxAgeSeconds is an invalid integer Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
commit
15a0f1ec33
@ -127,6 +127,10 @@ bool RGWCORSRule_S3::xml_end(const char *el) {
|
||||
char *end = NULL;
|
||||
|
||||
unsigned long long ull = strtoull(obj->get_data().c_str(), &end, 10);
|
||||
if (*end != '\0') {
|
||||
dout(0) << "RGWCORSRule's MaxAgeSeconds " << obj->get_data() << " is an invalid integer" << dendl;
|
||||
return false;
|
||||
}
|
||||
if (ull >= 0x100000000ull) {
|
||||
max_age = CORS_MAX_AGE_INVALID;
|
||||
} else {
|
||||
|
@ -2372,13 +2372,13 @@ int RGWPutCORS_ObjStore_S3::get_params()
|
||||
}
|
||||
|
||||
if (!data || !parser.parse(data, len, 1)) {
|
||||
return -EINVAL;
|
||||
return -ERR_MALFORMED_XML;
|
||||
}
|
||||
cors_config =
|
||||
static_cast<RGWCORSConfiguration_S3 *>(parser.find_first(
|
||||
"CORSConfiguration"));
|
||||
if (!cors_config) {
|
||||
return -EINVAL;
|
||||
return -ERR_MALFORMED_XML;
|
||||
}
|
||||
|
||||
#define CORS_RULES_MAX_NUM 100
|
||||
|
Loading…
Reference in New Issue
Block a user