]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_rest.cc: remove dead and unneeded code
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 10 May 2013 12:03:13 +0000 (14:03 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 10 May 2013 22:02:55 +0000 (00:02 +0200)
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>
src/rgw/rgw_rest.cc

index ba38a034c94bd2a4f969111471e9c43eb2c71ed4..48d09d69ca69eb9021c103ce96bd2ffe6bef02d0 100644 (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')) {