summaryrefslogtreecommitdiff
path: root/http/server_test.ts
diff options
context:
space:
mode:
authorAurélien Bertron <aurelienbertron@gmail.com>2019-05-23 04:33:17 +0200
committerBert Belder <bertbelder@gmail.com>2019-05-22 19:33:17 -0700
commita4346a3ac947f3599a15aaa71666705066407e3a (patch)
treefdd115d963023388df890b4fe7e87a329a6d2b62 /http/server_test.ts
parent3cfc1244d8747a869fb370de2d057523852fbea9 (diff)
http: send an empty response body if none is provided (denoland/deno_std#429)
Fixes: denoland/deno_std#402 Original: https://github.com/denoland/deno_std/commit/e00e3fe33a4e57e8bebcf2b7cdd4f501674450d2
Diffstat (limited to 'http/server_test.ts')
-rw-r--r--http/server_test.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/http/server_test.ts b/http/server_test.ts
index e3baebd53..e17b29a4d 100644
--- a/http/server_test.ts
+++ b/http/server_test.ts
@@ -31,7 +31,14 @@ const responseTests: ResponseTest[] = [
// Default response
{
response: {},
- raw: "HTTP/1.1 200 OK\r\n" + "\r\n"
+ raw: "HTTP/1.1 200 OK\r\n" + "content-length: 0" + "\r\n\r\n"
+ },
+ // Empty body with status
+ {
+ response: {
+ status: 404
+ },
+ raw: "HTTP/1.1 404 Not Found\r\n" + "content-length: 0" + "\r\n\r\n"
},
// HTTP/1.1, chunked coding; empty trailer; close
{