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:
Craig Drummond
2018-08-10 09:37:17 +01:00
committed by Craig Drummond
parent 75fda0bd23
commit 04402bf02f
2 changed files with 2 additions and 17 deletions

View File

@@ -154,16 +154,6 @@ static QList<QByteArray> split(const QByteArray &a)
return rv;
}
static bool isFromMpd(const QStringList &params)
{
for (const QString &str: params) {
if (str.startsWith("User-Agent:") && str.contains("Music Player Daemon")) {
return true;
}
}
return false;
}
static void getRange(const QStringList &params, 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;