Skip to content

Commit

Permalink
Fix a bug that QueryFrontend adds a garbage to http response (#415)
Browse files Browse the repository at this point in the history
Currently QueryFrontend sends ['http header' + 'content' + '\n'] as a http response to the outer side.
Our team found some error cases occurred by wrong value(content.length()) of Content-Length in the 'http header'.
To fix it, '\n' must be removed from the http response.
  • Loading branch information
withsmilo authored and dcrankshaw committed Feb 23, 2018
1 parent 1812b8c commit a128128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/frontends/src/query_frontend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void respond_http(std::string content, std::string message,
std::shared_ptr<HttpServer::Response> response) {
*response << "HTTP/1.1 " << message << "\r\nContent-Type: application/json"
<< "\r\nContent-Length: " << content.length() << "\r\n\r\n"
<< content << "\n";
<< content;
}

/* Generate a user-facing error message containing the exception
Expand Down

0 comments on commit a128128

Please sign in to comment.