Fetch: deviations from the WHATWG standard

This document lists the differences between the RSG runtime and the Fetch Standard. Each difference has an ID, such as F1 for fetch() or H1 for Headers. Items marked SDK are fixable in @roku-sdk; the other items are firmware behavior.

You can reproduce each result by running the fetch-spec-conformance example app.

In the Node.js 24 reference run, 24 of 25 checks pass; only F2 fails (a Roku extension). Streaming, CORS, redirect modes, and referrer policy are untested.

fetch()

The following table lists the differences in the global fetch() function.

IDStandardRSG
F1Invalid init rejects with TypeErrorRejection fails instanceof TypeError
F2Not part of the standardfetch.isFeatureSupported, fetch.apiVersion typed but undefined (SDK)

Headers

The following table lists the differences in the Headers class.

IDStandardRSG
H1new Headers()Throws (SDK)
H2Sequence initThrows; record init only
H3Case-insensitive namesCase-sensitive
H4append combines valuesKeeps first value
H5Missing name: get() returns nullundefined
H6Invalid names throwAccepted
H7Values normalized for whitespaceNot normalized
H8Iterable; entries, forEach, getSetCookieMissing
H9keys()/values(): sorted, lower-cased iteratorsArrays, insertion order

Request

The following table lists the differences in the Request class.

IDStandardRSG
RQ1Body methods, cloneMissing
RQ2mode, credentials, cache, redirect, referrer, referrerPolicy, integrity, keepalive, signal, duplexMissing
RQ3Relative URLs resolvedKept as-is
RQ4Forbidden method throws TypeErrorThrows Error

Response

The following table lists the differences in the Response class.

IDStandardRSG
RS1Global ResponseMissing (SDK)
RS2new Response(body, init)Does not accept any arguments
RS3error, json, redirect staticsMissing
RS4statusText, type, redirected, body, bodyUsed, clone, formDataMissing
RS5blob() returns BlobReturns ArrayBuffer
RS6Reused body rejects with TypeErrorRejects with Error

AbortController / AbortSignal

The following table lists the differences in the AbortController and AbortSignal classes.

IDStandardRSG
A1Global AbortControllerTyped, but constructor throws (SDK)
A2addEventListener, onabort, throwIfAbortedMissing
A3abort, timeout, any staticsMissing

Missing globals (G1)

The RSG runtime does not define the following globals: ReadableStream, WritableStream, TransformStream, Blob, File, FormData, URL, URLSearchParams, TextDecoder, DOMException, Event, EventTarget, and structuredClone.


Did this page help you?