stack/apps/skills
Mantra a84c7814de
Use Accept header for skills HTML/markdown negotiation (#1454)
## Summary

Follow-up to #1452. `Sec-Fetch-Mode` / `Sec-Fetch-Dest` didn't reliably
split HTML vs. markdown at the CDN edge, so curl could still get the
HTML landing page. Switch to the `Accept` header:

- Browsers send `Accept: text/html,...` on top-level navigations.
- `curl`, `fetch()`, and agent fetchers send `*/*` or omit `Accept`.
- Serve HTML only when `text/html` is explicitly listed; everything else
gets `SKILL.md`.
- `Vary` updated to `Accept` to match.

## Test plan

- [ ] Deploy preview
- [ ] `curl -sSL https://skill.stack-auth.com/ | head -3` returns
markdown frontmatter
- [ ] Browser load of `https://skill.stack-auth.com/` still shows the
HTML landing page
- [ ] Purge Vercel cache if stale variants persist

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved content format negotiation for skill resources to correctly
serve HTML or markdown based on client requests.

* **Chores**
* Optimized caching behavior for edge and CDN services to enhance global
content distribution efficiency.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/hexclave/stack-auth/pull/1454?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-20 13:15:13 -07:00
..
src/app Use Accept header for skills HTML/markdown negotiation (#1454) 2026-05-20 13:15:13 -07:00
.eslintrc.cjs [Feat] Hexclave AI integration: skill, MCP SKILL.md route, docs (#1434) 2026-05-15 14:30:23 -07:00
next.config.mjs [Feat] Hexclave AI integration: skill, MCP SKILL.md route, docs (#1434) 2026-05-15 14:30:23 -07:00
package.json chore: update package versions 2026-05-20 11:58:44 -07:00
tsconfig.json [Feat] Hexclave AI integration: skill, MCP SKILL.md route, docs (#1434) 2026-05-15 14:30:23 -07:00