mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
Implement HTTP host header filtering
This filtering is required to defend against DNS rebinding attack.
This commit is contained in:
committed by
sledgehammer999
parent
18651c8d01
commit
0532d546d7
@@ -74,8 +74,8 @@ void Connection::read()
|
||||
break;
|
||||
|
||||
case RequestParser::NoError:
|
||||
Environment env;
|
||||
env.clientAddress = m_socket->peerAddress();
|
||||
const Environment env {m_socket->localAddress(), m_socket->localPort(), m_socket->peerAddress(), m_socket->peerPort()};
|
||||
|
||||
Response response = m_requestHandler->processRequest(request, env);
|
||||
if (acceptsGzipEncoding(request.headers["accept-encoding"]))
|
||||
response.headers[HEADER_CONTENT_ENCODING] = "gzip";
|
||||
|
||||
Reference in New Issue
Block a user