Skip to content

Return 406 Not Acceptable for unsupported Accept headers - #9

Merged
retlehs merged 1 commit into
mainfrom
strict-accept-406
Apr 18, 2026
Merged

retlehs merged 1 commit into
mainfrom
strict-accept-406

Conversation

@retlehs

@retlehs retlehs commented Apr 18, 2026

Copy link
Copy Markdown
Member

When the client's Accept header rules out every representation the plugin can serve (neither text/html nor text/markdown produces a q-value above zero), respond with 406 Not Acceptable and a plain-text body listing the available representations. Previously the request fell through to WordPress's normal HTML render, silently ignoring the client's explicit preferences.

Skips feeds and wp-admin. Opt-out via the post_content_to_markdown/strict_accept filter for sites that prefer always-HTML fallback behavior.

@retlehs retlehs self-assigned this Apr 18, 2026
@retlehs
retlehs merged commit 5d9c123 into main Apr 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant