Skip to content

Warn on invalid headers #12784

Description

@Rich-Harris

Describe the problem

It's very easy to do this sort of thing:

setHeaders({
  'cache-control': 'public, maxage=3600'
});

This would fail because maxage isn't valid — it should be max-age — but you need hawk eyes to spot it.

Describe the proposed solution

Ideally we'd be able to express this stuff in types. Failing that, we could add some (likely dev-only) runtime validation.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions