rgw/rgw_rest.cc: remove dead and unneeded code

Since origin and meth are already checked to be true there is
no need to check again in s->cio->print() after the initial check.

1019551 Logically dead code (CWE-561)
1019552 Logically dead code (CWE-561)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2013-05-10 14:03:13 +02:00
parent 5babc816e0
commit b097f65627

View File

@ -347,9 +347,9 @@ void dump_owner(struct req_state *s, string& id, string& name, const char *secti
void dump_access_control(struct req_state *s, const char *origin, const char *meth,
const char *hdr, const char *exp_hdr, uint32_t max_age) {
if (origin && (origin[0] != '\0')) {
s->cio->print("Access-Control-Allow-Origin: %s\n", origin?origin:"");
s->cio->print("Access-Control-Allow-Origin: %s\n", origin);
if (meth && (meth[0] != '\0'))
s->cio->print("Access-Control-Allow-Methods: %s\n", meth?meth:"");
s->cio->print("Access-Control-Allow-Methods: %s\n", meth);
if (hdr && (hdr[0] != '\0'))
s->cio->print("Access-Control-Allow-Headers: %s\n", hdr);
if (exp_hdr && (exp_hdr[0] != '\0')) {