mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
Send 204 when WebAPI response contains no data
This commit is contained in:
parent
20482be4a8
commit
72548fd18d
1 changed files with 34 additions and 27 deletions
|
@ -361,6 +361,12 @@ void WebApplication::doProcessRequest()
|
|||
try
|
||||
{
|
||||
const APIResult result = controller->run(action, m_params, data);
|
||||
if (result.data.isNull())
|
||||
{
|
||||
status(204);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (result.data.userType())
|
||||
{
|
||||
case QMetaType::QJsonDocument:
|
||||
|
@ -393,6 +399,7 @@ void WebApplication::doProcessRequest()
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const APIError &error)
|
||||
{
|
||||
// re-throw as HTTPError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue