Use only session id when one is available, strips out user-agent multiples on apple devices.
This commit is contained in:
parent
5a8b9be44a
commit
d04774cab5
1 changed files with 9 additions and 2 deletions
|
@ -211,8 +211,15 @@ namespace Mist {
|
||||||
|
|
||||||
void HTTPOutput::onRequest(){
|
void HTTPOutput::onRequest(){
|
||||||
while (H.Read(myConn)){
|
while (H.Read(myConn)){
|
||||||
std::string ua = H.GetHeader("User-Agent") + H.GetHeader("X-Playback-Session-Id") + H.GetVar("sessId");
|
//If no sessionID --> take first 2, else take session id.
|
||||||
crc = checksum::crc32(0, ua.data(), ua.size());
|
if (H.GetVar("sessId").size()){
|
||||||
|
std::string ua = H.GetVar("sessId");
|
||||||
|
crc = checksum::crc32(0, ua.data(), ua.size());
|
||||||
|
}else{
|
||||||
|
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());
|
INFO_MSG("Received request %s", H.getUrl().c_str());
|
||||||
selectedTracks.clear();
|
selectedTracks.clear();
|
||||||
if (H.GetVar("audio") != ""){
|
if (H.GetVar("audio") != ""){
|
||||||
|
|
Loading…
Add table
Reference in a new issue