Skip to content

Commit

Permalink
Update transport_v1.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
maddsua committed Feb 13, 2024
1 parent f6df855 commit 7efb713
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/http/transport_v1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,6 @@ void TransportContextV1::respond(const Response& response) {
std::vector<uint8_t> headerBuff;
headerBuff.reserve(2048);

static const std::string lineSeparator = "\r\n";
static const std::string headerSeparator = ": ";

// push http version
static const std::string httpVersion = "HTTP/1.1";
headerBuff.insert(headerBuff.end(), httpVersion.begin(), httpVersion.end());
Expand All @@ -310,9 +307,12 @@ void TransportContextV1::respond(const Response& response) {
// push response status text
const auto& statusText = response.status.text();
headerBuff.insert(headerBuff.end(), statusText.begin(), statusText.end());

static const std::string lineSeparator = "\r\n";
headerBuff.insert(headerBuff.end(), lineSeparator.begin(), lineSeparator.end());

// serialize headers
static const std::string headerSeparator = ": ";
for (const auto& header : responseHeaders.entries()) {
headerBuff.insert(headerBuff.end(), header.first.begin(), header.first.end());
headerBuff.insert(headerBuff.end(), headerSeparator.begin(), headerSeparator.end());
Expand Down

0 comments on commit 7efb713

Please sign in to comment.