]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_cors.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / rgw / rgw_cors.cc
index 3fa600ad1d60ad0607edd01ba475b9b19d5eb9fa..83ba079b2509de8ec50377f98de6cdce0efdff15 100644 (file)
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rgw
 
+using namespace std;
+
 void RGWCORSRule::dump_origins() {
   unsigned num_origins = allowed_origins.size();
   dout(10) << "Allowed origins : " << num_origins << dendl;
-  for(set<string>::iterator it = allowed_origins.begin();
-      it != allowed_origins.end(); 
-      ++it) {
-    dout(10) << *it << "," << dendl;
+  for(auto& origin : allowed_origins) {
+    dout(10) << origin << "," << dendl;
   }
 }
 
@@ -148,9 +148,8 @@ void RGWCORSRule::format_exp_headers(string& s) {
     if (s.length() > 0)
       s.append(",");
     // these values are sent to clients in a 'Access-Control-Expose-Headers'
-    // response header, so we escape '\n' and '\r' to avoid header injection
-    std::string tmp = boost::replace_all_copy(header, "\n", "\\n");
-    boost::replace_all_copy(std::back_inserter(s), tmp, "\r", "\\r");
+    // response header, so we escape '\n' to avoid header injection
+    boost::replace_all_copy(std::back_inserter(s), header, "\n", "\\n");
   }
 }