Remove user-agent checking when serving local files, this is easily fake-able and breaks playback to forked-daap (and mopidy?)
Issue #1339
This commit is contained in:
committed by
Craig Drummond
parent
75fda0bd23
commit
04402bf02f
@@ -154,16 +154,6 @@ static QList<QByteArray> split(const QByteArray &a)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static bool isFromMpd(const QStringList ¶ms)
|
||||
{
|
||||
for (const QString &str: params) {
|
||||
if (str.startsWith("User-Agent:") && str.contains("Music Player Daemon")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void getRange(const QStringList ¶ms, qint32 &from, qint32 &to)
|
||||
{
|
||||
for (const QString &str: params) {
|
||||
@@ -279,13 +269,6 @@ void HttpSocket::readClient()
|
||||
QStringList params = QString(socket->readAll()).split(QRegExp("[\r\n][\r\n]*"));
|
||||
|
||||
DBUG << "params" << params << "tokens" << tokens;
|
||||
if (!isFromMpd(params)) {
|
||||
sendErrorResponse(socket, 400);
|
||||
socket->close();
|
||||
DBUG << "Not from MPD";
|
||||
return;
|
||||
}
|
||||
|
||||
QUrl url(QUrl::fromEncoded(tokens[1]));
|
||||
QUrlQuery q(url);
|
||||
bool ok=false;
|
||||
|
||||
Reference in New Issue
Block a user