diff options
Diffstat (limited to 'std/textproto')
-rw-r--r-- | std/textproto/mod.ts | 6 | ||||
-rw-r--r-- | std/textproto/test.ts | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/std/textproto/mod.ts b/std/textproto/mod.ts index 1d0d22715..b23ccee19 100644 --- a/std/textproto/mod.ts +++ b/std/textproto/mod.ts @@ -71,7 +71,7 @@ export class TextProtoReader { throw new Deno.errors.UnexpectedEof(); } else if (buf[0] == charCode(" ") || buf[0] == charCode("\t")) { throw new Deno.errors.InvalidData( - `malformed MIME header initial line: ${str(line)}` + `malformed MIME header initial line: ${str(line)}`, ); } @@ -84,7 +84,7 @@ export class TextProtoReader { let i = kv.indexOf(charCode(":")); if (i < 0) { throw new Deno.errors.InvalidData( - `malformed MIME header line: ${str(kv)}` + `malformed MIME header line: ${str(kv)}`, ); } @@ -110,7 +110,7 @@ export class TextProtoReader { } const value = str(kv.subarray(i)).replace( invalidHeaderCharRegex, - encodeURI + encodeURI, ); // In case of invalid header we swallow the error diff --git a/std/textproto/test.ts b/std/textproto/test.ts index a7109410b..1d4bed50b 100644 --- a/std/textproto/test.ts +++ b/std/textproto/test.ts @@ -96,8 +96,7 @@ Deno.test({ Deno.test({ name: "[textproto] Reader : MIME Header Non compliant", async fn(): Promise<void> { - const input = - "Foo: bar\r\n" + + const input = "Foo: bar\r\n" + "Content-Language: en\r\n" + "SID : 0\r\n" + "Audio Mode : None\r\n" + @@ -143,9 +142,7 @@ Deno.test({ Deno.test({ name: "[textproto] Reader : MIME Header Trim Continued", async fn(): Promise<void> { - const input = - "" + // for code formatting purpose. - "a:\n" + + const input = "a:\n" + " 0 \r\n" + "b:1 \t\r\n" + "c: 2\r\n" + @@ -185,7 +182,7 @@ Deno.test({ const input = "abcdefghijklmnopqrstuvwxyz"; const bufSize = 25; const tp = new TextProtoReader( - new BufReader(new StringReader(input), bufSize) + new BufReader(new StringReader(input), bufSize), ); const line = await tp.readLine(); assertEquals(line, input); |