Skip to content

Allow setting per-template content negotiation defaults #588

@fluffy-critter

Description

@fluffy-critter

Expected Behavior

As a followup from #157 / #587, please allow the site operator to designate which templates should take precedence when there's no Accept: header provided.

Current Behavior

The current priority ordering is super arbitrary.

Possible Solution

Provide a priority mapping for extensions on a per-template-name basis, e.g.

config.template_default = {
    'feed': ['.atom', '.xml', '.html'],
    'calendar': ['.ics', '.html'],
    'index': ['.html'],
    '': ['.html']
}

Which is of course only meant to be an example, since generally only one or two templates will have content-type negotiation or multiple renditions to begin with.

Context

Several RSS-consuming clients (e.g. feed readers and the MonitoRSS Discord bot) do not send an Accept: header, and defaulting to HTML leads to incorrect behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions