Remove the check for read_cors_config in rgw_main.cc, and changes type of 'a' to unsigned from long as max_age cannot be a negative integer
Modified the type of 'a' to unsigned long and used ULONG_MAX and strtol in rgw_cors_swift.h
Signed-off-by: Babu Shanmugam <anbu@enovance.com>
const char *expose_headers, const char *max_age) {
set<string> o, h, oc;
list<string> e;
- long a = CORS_MAX_AGE_INVALID;
+ unsigned a = CORS_MAX_AGE_INVALID;
uint8_t flags = RGW_CORS_ALL;
string ao = allow_origins;
return -EINVAL;
}
}
+
if (expose_headers) {
string eh = expose_headers;
get_str_list(eh, e);
}
if (max_age) {
char *end = NULL;
- a = strtol(max_age, &end, 10);
- if (a == LONG_MAX)
+ a = strtoul(max_age, &end, 10);
+ if (a == ULONG_MAX)
a = CORS_MAX_AGE_INVALID;
}
abort_early(s, ret);
goto done;
}
+
req->log(s, "reading the cors attr");
- ret = handler->read_cors_config();
- if (ret < 0) {
- abort_early(s, ret);
- goto done;
- }
+ handler->read_cors_config();
req->log(s, "verifying op permissions");
ret = op->verify_permission();