Skip to content

static method: Response.html?Β #1865

@noamr

Description

@noamr

What problem are you trying to solve?

Making it easier to serve HTML content directly from a service worker.

What solutions exist today?

This is actually quite easy:

new Response(html, { headers: { "Content-Type": "text/html" } })

However not very discoverable and doesn't feel "encouraged".

How would you solve it?

Response.html(html_string), kind of like Response.json(jsonable_object), can perform the same as the existing solution, but in an ergonomic/"encouraged" way.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions