浏览代码

replace X-Origin-IP with X-Real-IP

ithewei 3 年之前
父节点
当前提交
44b42b9c23
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      http/server/HttpHandler.cpp

+ 1 - 1
http/server/HttpHandler.cpp

@@ -267,7 +267,7 @@ void HttpHandler::onProxyConnect(hio_t* upstream_io) {
     // NOTE: send head + received body
     // NOTE: send head + received body
     req->headers.erase("Proxy-Connection");
     req->headers.erase("Proxy-Connection");
     req->headers["Connection"] = handler->keepalive ? "keep-alive" : "close";
     req->headers["Connection"] = handler->keepalive ? "keep-alive" : "close";
-    req->headers["X-Origin-IP"] = handler->ip;
+    req->headers["X-Real-IP"] = handler->ip;
     std::string msg = req->Dump(true, true);
     std::string msg = req->Dump(true, true);
     // printf("%s\n", msg.c_str());
     // printf("%s\n", msg.c_str());
     hio_write(upstream_io, msg.c_str(), msg.size());
     hio_write(upstream_io, msg.c_str(), msg.size());