Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/network/network_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ NetworkSocket::NetworkSocket(QWebSocket *f_socket, QObject *parent) :
// TLDR : We check if the header comes trough a proxy/tunnel running locally.
// This is to ensure nobody can send those headers from the web.
QNetworkRequest l_request = m_client_socket->request();
if (l_request.hasRawHeader("x-forwarded-for") && l_is_local) {
if (l_request.hasRawHeader("x-real-ip") && l_is_local) {
m_socket_ip = QHostAddress(QString::fromUtf8(l_request.rawHeader("x-real-ip")));
}
else if (l_request.hasRawHeader("x-forwarded-for") && l_is_local) {
m_socket_ip = QHostAddress(QString::fromUtf8(l_request.rawHeader("x-forwarded-for")));
}
else {
Expand Down