Skip to content

Commit 210eba9

Browse files
committed
[REST] fix headersonly flag for BINARY responses
1 parent 4baa9f0 commit 210eba9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static bool rest_block(AcceptedConnection *conn,
100100
switch (rf) {
101101
case RF_BINARY: {
102102
string binaryBlock = ssBlock.str();
103-
conn->stream() << HTTPReply(HTTP_OK, binaryBlock, fRun, true, "application/octet-stream") << binaryBlock << std::flush;
103+
conn->stream() << HTTPReplyHeader(HTTP_OK, fRun, binaryBlock.size(), "application/octet-stream") << binaryBlock << std::flush;
104104
return true;
105105
}
106106

@@ -148,7 +148,7 @@ static bool rest_tx(AcceptedConnection *conn,
148148
switch (rf) {
149149
case RF_BINARY: {
150150
string binaryTx = ssTx.str();
151-
conn->stream() << HTTPReply(HTTP_OK, binaryTx, fRun, true, "application/octet-stream") << binaryTx << std::flush;
151+
conn->stream() << HTTPReplyHeader(HTTP_OK, fRun, binaryTx.size(), "application/octet-stream") << binaryTx << std::flush;
152152
return true;
153153
}
154154

0 commit comments

Comments
 (0)