From babbcf706af5b939c63b66d102f033a0e1a85e0e Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 19 Apr 2016 18:25:10 +0200 Subject: [PATCH] Add support for telling iOS devices apart by X-Playback-Session-Id and allow IPv6-mapped IPv4 addresses to be properly recognized by the trusted proxy setting. --- src/output/output_http.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/output/output_http.cpp b/src/output/output_http.cpp index fae55a67..9a1dca33 100644 --- a/src/output/output_http.cpp +++ b/src/output/output_http.cpp @@ -211,7 +211,7 @@ namespace Mist { void HTTPOutput::onRequest(){ while (H.Read(myConn)){ - std::string ua = H.GetHeader("User-Agent"); + std::string ua = H.GetHeader("User-Agent") + H.GetHeader("X-Playback-Session-Id"); crc = checksum::crc32(0, ua.data(), ua.size()); INFO_MSG("Received request %s", H.getUrl().c_str()); selectedTracks.clear(); @@ -393,7 +393,8 @@ namespace Mist { } } } - return trustedProxies.count(ip); + //Make sure to also check for IPv6 addresses + return trustedProxies.count(ip) > 0 || trustedProxies.count("::ffff:"+ip) > 0; } /*LTS-END*/ /*begin-roxlu*/