summaryrefslogtreecommitdiff
path: root/textproto/mod.ts
diff options
context:
space:
mode:
authorVincent LE GOFF <g_n_s@hotmail.fr>2019-05-01 18:13:23 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-05-01 12:13:23 -0400
commit80161217d38acd76cd09f40e40986cc4a90e14ac (patch)
tree91608ff77abec36e743de8825f3273dfc1759d31 /textproto/mod.ts
parentadf9cf9949bff27ab1332957078cf4436aebea85 (diff)
textproto: fix invalid header error and move tests (denoland/deno_std#369)
Original: https://github.com/denoland/deno_std/commit/b6aaddbcc060287e8c349a875a19df8fcd0620f3
Diffstat (limited to 'textproto/mod.ts')
-rw-r--r--textproto/mod.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/textproto/mod.ts b/textproto/mod.ts
index 28eac4609..74c7b6662 100644
--- a/textproto/mod.ts
+++ b/textproto/mod.ts
@@ -119,7 +119,11 @@ export class TextProtoReader {
}
let value = str(kv.subarray(i));
- m.append(key, value);
+ // In case of invalid header we swallow the error
+ // example: "Audio Mode" => invalid due to space in the key
+ try {
+ m.append(key, value);
+ } catch {}
if (err != null) {
throw err;