One URL. Any Accept.
Open Real-World App: PageMorph (/app) ↗
Every request below hits the same canonical URL. Only the HTTP Accept header changes. An edge Worker parses the page once and compiles it into a manga page, a slide deck, a podcast script, flashcards, a Risograph zine, or a spec tree. None of these media types are registered with IANA.
HTTP wire inspector
Request
Waiting for the first request.
curl
Response headers
Body
IANA & RFC 9110 reality matrix
RFC 9110 only requires type/subtype to be valid tokens, so every row parses. Registration is a separate question: IANA lists eleven top-level types, and comic, deck, study, visual, code, and theater are not among them.
| Media type | RFC 9110 syntax | IANA top-level | IANA subtype | Body on the wire | Cache keys | Strict mode |
|---|
Strict 406 falsification check
Hypothesis: a server can accept any well-formed type/subtype without breaking HTTP semantics. Falsifier: in strict mode the same server must refuse unknown types with 406 Not Acceptable and list alternates in Link, while built-in faux types still return 200.
| Accept | Query | Expected | Observed | X-Media-Type-Mode | Result |
|---|---|---|---|---|---|
| Not run yet. | |||||
How this is set up
- Canonical source.
/pages/:slugserves three hand-structured pages./transform?url=https://…fetches any public HTTPS page (HTTPS only, private/loopback/metadata addresses blocked on every redirect hop, 512 KiB cap, 5 s timeout) and extracts headings, paragraphs, quotes, lists, and code with Cloudflare's streamingHTMLRewriter. - Negotiation.
src/negotiate.tsparses theAcceptheader per RFC 9110: quoted parameters, q-values, specificity, and token grammar. Exact faux types win,type/*maps to the faux type with that prefix, and any other validtype/subtypebecomescustom-synthesizedunless?strict=1is set. - Compilation.
src/transforms.tscompiles the document into panels, slides, turns, cards, zine pages, or a graph. It reads parameters such asreading,panels,tone,hosts, andslides, and reports unused ones inX-Accept-Params-Ignored. - One drawing routine, two outputs.
public/comic-art.jsbuilds a DOM-free scene graph per panel. The browser turns it into nodes withcreateElementNS; the Worker serializes the same graph for?export=svg. - Honest headers. Each response carries
Vary: Accept,Content-Location,Linkalternates,X-IANA-Registered,X-Syntax-Valid-RFC9110,X-Cache-Risk,X-Source-Bytes, andX-Extraction-Parser. - Optional live AI. The rewrite bar sends only the rendered text fields plus a source excerpt to the provider you pick. The edge output stays available through Revert.
curl -i https://malleable-accept-studio.kinlan-test.workers.dev/pages/hyper-content-negotiation \
-H 'Accept: comic/manga; reading=ltr; panels=6; tone=noir'
curl -o manga.svg 'https://malleable-accept-studio.kinlan-test.workers.dev/pages/hyper-content-negotiation?export=svg' \
-H 'Accept: comic/manga'
curl -i 'https://malleable-accept-studio.kinlan-test.workers.dev/pages/hyper-content-negotiation?strict=1' \
-H 'Accept: theater/stage-play' # 406 Not Acceptable
Glossary
- Accept (RFC 9110 §12.5.1)
- The request header listing media ranges the client prefers, with optional parameters and q-values from 0 to 1.
- Content negotiation (RFC 9110 §12)
- Selecting one representation of a resource based on request headers, while the URL stays the same.
- IANA media types registry
- The official list of registered top-level types and subtypes.
comic/mangais not in it. - RFC 6838: media type registration
- Rules for registering subtypes in the standards, vendor (
vnd.), and personal trees, and for defining new top-level types. - 406 Not Acceptable
- The status a server may return when none of the requested media ranges can be served.
- Vary
- Tells caches which request headers change the response.
Vary: Acceptmultiplies cache keys by the number of distinctAcceptvalues. - HTMLRewriter
- Cloudflare's streaming HTML parser, used here to extract structure from remote pages without a DOM.
- Web Speech API
- Browser speech synthesis used to play the
audio/podcastscript with alternating voices.