Skip to content

Web Assets feature: Some way to set Headers for requests #21352

@laundmo

Description

@laundmo

What problem does this solve or what need does it fill?

A common authentication scheme is providing Tokens/Keys as a Header. Similarily, some public services require, in their ToS/License, a custom User-Agent header for each application with some kind of identifiable information (email address of developer) they can use to reach out in case of (accidental) abuse.

What solution would you like?

My ideas:

  • A pre-request callback which is passed the asset path (URL) and can return settings for that request (more flexible)
  • A field on the plugin which allows customizing request settings like Headers per (sub-)domain

What alternative(s) have you considered?

Relying on third party libraries for this: Duplicates work and code to maintain

Additional context

There is a series of PRs for bevy_web_asset about this, partially by me, which never got merged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsC-FeatureA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions