Skip to content

Commit a1c247c

Browse files
committed
Add writeBody() method with status code for stream version.
This is a rebased version of #25 by @ljmf00 Fixes #25.
1 parent d4f2619 commit a1c247c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/vibe/http/server.d

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,12 @@ scope:
13071307
else if ("Content-Type" !in headers) headers["Content-Type"] = "application/octet-stream";
13081308
data.pipe(bodyWriter);
13091309
}
1310+
/// ditto
1311+
void writeBody(scope InputStream data, int status, string content_type = null)
1312+
{
1313+
statusCode = status;
1314+
writeBody(data, content_type);
1315+
}
13101316

13111317
/** Writes the entire response body as a single string.
13121318
@@ -1320,7 +1326,6 @@ scope:
13201326
13211327
See_Also: `HTTPStatusCode`
13221328
*/
1323-
/// ditto
13241329
void writeBody(string data, string content_type = null)
13251330
@safe {
13261331
if (!content_type.length && "Content-Type" !in headers)

0 commit comments

Comments
 (0)