Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added default body for error pages

  • Loading branch information...
commit 39a676f053339e81a795eabb51402fdd0f57d220 1 parent 02b8903
@paulbarbu authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 httpconnection.cpp
View
5 httpconnection.cpp
@@ -61,6 +61,11 @@ void HTTPConnection::write(uchar *data, int size)
void HTTPConnection::write(HTTPResponse response)
{
+ //TODO: for status codes that doesn't make sense, don't set the body
+ if("200" != response.getStatusCode() && response.getBody().isEmpty()){
+ response.setBody(response.getStatusCode() + " " + response.getReasonPhrase());
+ }
+
QByteArray partialResponse = response.getPartial();
qDebug() << Q_FUNC_INFO << "Writing" << partialResponse.size() << "bytes";
Please sign in to comment.
Something went wrong with that request. Please try again.