Browse Source

Merge pull request #12835 from Piccirello/web-content-type

Specify Content-Type in Web API error responses
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
c85d2e547b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/webui/webapplication.cpp

3
src/webui/webapplication.cpp

@ -466,8 +466,7 @@ Http::Response WebApplication::processRequest(const Http::Request &request, cons @@ -466,8 +466,7 @@ Http::Response WebApplication::processRequest(const Http::Request &request, cons
}
catch (const HTTPError &error) {
status(error.statusCode(), error.statusText());
if (!error.message().isEmpty())
print(error.message(), Http::CONTENT_TYPE_TXT);
print((!error.message().isEmpty() ? error.message() : error.statusText()), Http::CONTENT_TYPE_TXT);
}
for (const Http::Header &prebuiltHeader : asConst(m_prebuiltHeaders))

Loading…
Cancel
Save