Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting per-template content negotiation defaults #588

Open
fluffy-critter opened this issue Jan 2, 2025 · 0 comments
Open

Allow setting per-template content negotiation defaults #588

fluffy-critter opened this issue Jan 2, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@fluffy-critter
Copy link
Collaborator

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.

@fluffy-critter fluffy-critter added the enhancement New feature or request label Jan 2, 2025
@fluffy-critter fluffy-critter changed the title Allow setting per-template default handling priority Allow setting per-template content negotiation defaults Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant