Files
node/lib
Christian Aurich Zanettini Martins cc610f1cfb fs: validate falsy openAsBlob type option
openAsBlob() and openAsBlobSync() read the MIME type as
options.type || '' before validating it, causing falsy non-string
values to be replaced with the default before reaching validateString().
As a result, { type: 0 }, { type: false }, { type: null }, and
{ type: NaN } are accepted as an empty type, while { type: 1 }
throws ERR_INVALID_ARG_TYPE.

Default the option only when it is undefined so all other values are
validated against the documented string type.

Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66125
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-09-25 19:44:48 +00:00
..
2026-09-03 15:37:21 +00:00
…
…
…
2026-07-05 08:04:44 +00:00
…
…
…
2026-09-05 02:49:02 +00:00
2026-09-19 05:21:30 +00:00
2026-09-12 11:52:10 +00:00
2026-09-03 11:40:52 +02:00
2026-09-15 08:33:52 +00:00
…
…
…
2026-09-12 20:46:35 +00:00
…
2026-07-25 23:56:46 -07:00
…
…
…
…
…
2026-08-23 15:52:12 +00:00
…
2026-09-03 11:48:46 +02:00
2026-09-11 14:57:09 +00:00