mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 23:37:59 +00:00
Merge pull request #12835 from Piccirello/web-content-type
Specify Content-Type in Web API error responses
This commit is contained in:
commit
c85d2e547b
@ -466,8 +466,7 @@ Http::Response WebApplication::processRequest(const Http::Request &request, cons
|
|||||||
}
|
}
|
||||||
catch (const HTTPError &error) {
|
catch (const HTTPError &error) {
|
||||||
status(error.statusCode(), error.statusText());
|
status(error.statusCode(), error.statusText());
|
||||||
if (!error.message().isEmpty())
|
print((!error.message().isEmpty() ? error.message() : error.statusText()), Http::CONTENT_TYPE_TXT);
|
||||||
print(error.message(), Http::CONTENT_TYPE_TXT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const Http::Header &prebuiltHeader : asConst(m_prebuiltHeaders))
|
for (const Http::Header &prebuiltHeader : asConst(m_prebuiltHeaders))
|
||||||
|
Loading…
Reference in New Issue
Block a user