Browse Source

Code cleanup

yhirose 2 years ago
parent
commit
c30906a541
1 changed files with 2 additions and 7 deletions
  1. 2 7
      httplib.h

+ 2 - 7
httplib.h

@@ -6262,15 +6262,10 @@ Server::process_request(Stream &strm, bool close_connection,
   if (!line_reader.getline()) { return false; }
 
   Request req;
-  Response res;
 
+  Response res;
   res.version = "HTTP/1.1";
-
-  for (const auto &header : default_headers_) {
-    if (res.headers.find(header.first) == res.headers.end()) {
-      res.headers.insert(header);
-    }
-  }
+  res.headers = default_headers_;
 
 #ifdef _WIN32
   // TODO: Increase FD_SETSIZE statically (libzmq), dynamically (MySQL).