summaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
authorAxetroy <axetroy.dev@gmail.com>2019-06-19 12:22:01 +0800
committerRyan Dahl <ry@tinyclouds.org>2019-06-18 21:22:01 -0700
commitc85b1c06a9804ad41fbccf8fe5a5689f28eb049e (patch)
treee855fc7c02baaa219aa81a2a54a69b19c1fb3716 /http
parentd6e92582cc2267210f71e893b14672783301f87b (diff)
lint: add max line length rules (denoland/deno_std#507)
Original: https://github.com/denoland/deno_std/commit/b04fda30c8949b6347094b898bfa427c0b9a6162
Diffstat (limited to 'http')
-rw-r--r--http/cookie.ts7
-rw-r--r--http/cookie_test.ts9
-rw-r--r--http/file_server_test.ts3
-rw-r--r--http/server_test.ts12
4 files changed, 20 insertions, 11 deletions
diff --git a/http/cookie.ts b/http/cookie.ts
index 026ed1984..843f626f1 100644
--- a/http/cookie.ts
+++ b/http/cookie.ts
@@ -97,9 +97,10 @@ export function getCookies(req: ServerRequest): Cookies {
* @param [cookie.domain] Specifies those hosts to which the cookie will be sent
* @param [cookie.path] Indicates a URL path that must exist in the request.
* @param [cookie.secure] Indicates if the cookie is made using SSL & HTTPS.
- * @param [cookie.httpOnly] Indicates that cookie is not accessible via Javascript
- * @param [cookie.sameSite] Allows servers to assert that a cookie ought not to be
- * sent along with cross-site requests
+ * @param [cookie.httpOnly] Indicates that cookie is not accessible via
+ * Javascript
+ * @param [cookie.sameSite] Allows servers to assert that a cookie ought not to
+ * be sent along with cross-site requests
* Example:
*
* setCookie(response, { name: 'deno', value: 'runtime',
diff --git a/http/cookie_test.ts b/http/cookie_test.ts
index 3d2e98afc..05ed324d2 100644
--- a/http/cookie_test.ts
+++ b/http/cookie_test.ts
@@ -124,7 +124,8 @@ test({
});
assertEquals(
res.headers.get("Set-Cookie"),
- "Space=Cat; Secure; HttpOnly; Max-Age=2; Domain=deno.land; SameSite=Strict"
+ "Space=Cat; Secure; HttpOnly; Max-Age=2; Domain=deno.land; " +
+ "SameSite=Strict"
);
res.headers = new Headers();
@@ -170,7 +171,8 @@ test({
});
assertEquals(
res.headers.get("Set-Cookie"),
- "Space=Cat; Secure; HttpOnly; Max-Age=2; Domain=deno.land; Path=/; unparsed=keyvalue; batman=Bruce"
+ "Space=Cat; Secure; HttpOnly; Max-Age=2; Domain=deno.land; Path=/; " +
+ "unparsed=keyvalue; batman=Bruce"
);
res.headers = new Headers();
@@ -186,7 +188,8 @@ test({
});
assertEquals(
res.headers.get("Set-Cookie"),
- "Space=Cat; Secure; HttpOnly; Max-Age=2; Domain=deno.land; Path=/; Expires=Fri, 07 Jan 1983 15:32:00 GMT"
+ "Space=Cat; Secure; HttpOnly; Max-Age=2; Domain=deno.land; Path=/; " +
+ "Expires=Fri, 07 Jan 1983 15:32:00 GMT"
);
res.headers = new Headers();
diff --git a/http/file_server_test.ts b/http/file_server_test.ts
index 201524e7b..1bd4e8160 100644
--- a/http/file_server_test.ts
+++ b/http/file_server_test.ts
@@ -59,7 +59,8 @@ test(async function serveDirectory(): Promise<void> {
assert(page.includes("azure-pipelines.yml"));
// `Deno.FileInfo` is not completely compatible with Windows yet
- // TODO: `mode` should work correctly in the future. Correct this test case accordingly.
+ // TODO: `mode` should work correctly in the future.
+ // Correct this test case accordingly.
Deno.platform.os !== "win" &&
assert(/<td class="mode">\([a-zA-Z-]{10}\)<\/td>/.test(page));
Deno.platform.os === "win" &&
diff --git a/http/server_test.ts b/http/server_test.ts
index b58523787..6b50057ea 100644
--- a/http/server_test.ts
+++ b/http/server_test.ts
@@ -359,17 +359,20 @@ test(async function testReadRequestError(): Promise<void> {
// See Issue 16490.
{
in:
- "POST / HTTP/1.1\r\nContent-Length: 10\r\nContent-Length: 0\r\n\r\nGopher hey\r\n",
+ "POST / HTTP/1.1\r\nContent-Length: 10\r\nContent-Length: 0\r\n\r\n" +
+ "Gopher hey\r\n",
err: "cannot contain multiple Content-Length headers"
},
{
in:
- "POST / HTTP/1.1\r\nContent-Length: 10\r\nContent-Length: 6\r\n\r\nGopher\r\n",
+ "POST / HTTP/1.1\r\nContent-Length: 10\r\nContent-Length: 6\r\n\r\n" +
+ "Gopher\r\n",
err: "cannot contain multiple Content-Length headers"
},
{
in:
- "PUT / HTTP/1.1\r\nContent-Length: 6 \r\nContent-Length: 6\r\nContent-Length:6\r\n\r\nGopher\r\n",
+ "PUT / HTTP/1.1\r\nContent-Length: 6 \r\nContent-Length: 6\r\n" +
+ "Content-Length:6\r\n\r\nGopher\r\n",
headers: [{ key: "Content-Length", value: "6" }]
},
{
@@ -388,7 +391,8 @@ test(async function testReadRequestError(): Promise<void> {
},
{
in:
- "POST / HTTP/1.1\r\nContent-Length:0\r\ntransfer-encoding: chunked\r\n\r\n",
+ "POST / HTTP/1.1\r\nContent-Length:0\r\ntransfer-encoding: " +
+ "chunked\r\n\r\n",
headers: [],
err: "http: Transfer-Encoding and Content-Length cannot be send together"
}