diff options
Diffstat (limited to 'deps/undici/src/lib/fileapi/encoding.js')
-rw-r--r-- | deps/undici/src/lib/fileapi/encoding.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/deps/undici/src/lib/fileapi/encoding.js b/deps/undici/src/lib/fileapi/encoding.js index 4aac20cce1..1d1d2b6544 100644 --- a/deps/undici/src/lib/fileapi/encoding.js +++ b/deps/undici/src/lib/fileapi/encoding.js @@ -2,9 +2,13 @@ /** * @see https://encoding.spec.whatwg.org/#concept-encoding-get - * @param {string} label + * @param {string|undefined} label */ function getEncoding (label) { + if (!label) { + return 'failure' + } + // 1. Remove any leading and trailing ASCII whitespace from label. // 2. If label is an ASCII case-insensitive match for any of the // labels listed in the table below, then return the |