The URI scheme to be served, stated in lowercase and with no trailing colon; the scheme of a target URL is matched against it disregarding case
The Fetch implementation serving scheme
Optionalinit: RequestInitOptionalinit: RequestInitA Middleware wrapping a Fetch implementation with one serving through handler every
exchange targeting a URL with scheme
Creates a protocol dispatching middleware.
The generated middleware serves through
handlerevery exchange targeting a URL with the givenschemeand relays every other exchange to the wrapped fetch implementation. The schemes the platform already resolves keep flowing to it untouched, while the ones it doesn't,fileorzipamong them, are supplied by a handler, without call sites having to know which is which.Layers are stacked to serve several schemes from a single client; where two of them state the same scheme, the outermost one serves it.
Handlers are Fetch implementations, so they report their outcome as a
Response, streaming the body as it is asked for and reporting failures as an unsuccessful status rather than as a thrown error: status handling stays with the consumer, whether a resource was retrieved from the network or from a local store.Exchanges reach their handler exactly as they were submitted, never normalised as a
Requestobject, so that a request carrying a body is passed on undisturbed.