Skip to content

Default router configuration #726

Description

@g105b

Originally posted by @g105b in #720

The router of WebEngine currently defaults to page requests unless specified with an Accept header, but I'm trying to enhance the usability of the default behaviour when prototyping APIs with curl.

Currently, we have this default config:

[router]
default_content_type=text/html

but I'd like to extend this into two default states: default_content_type, and no_match_content_type.

no_match_content_type would be used if there was no match, or if there was not an Accept header sent.

default_content_type would be used if there was a loose match, and a default needed picking. Because there could be more ambiguity with this, default_content_type should be able to be a comma/semicolon separated list of content types, where the best match would be used, according to the provided accept header. For example: text/* could match text/plain and text/html. If you care about the difference, you should be able to specify it here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions