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

Added example for X-Content-Type-Options in Fetch Standard #1809

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SaaraBilyour
Copy link

@SaaraBilyour SaaraBilyour commented Feb 12, 2025

Summary

This PR adds an example demonstrating how to use the X-Content-Type-Options HTTP header with the Fetch API.

Why This Change?

  • The X-Content-Type-Options header prevents MIME-type sniffing, improving web security.
  • The Fetch Standard currently lacks a practical example for this header.
  • This addition helps web developers skimming the spec to understand how to use it in real-world scenarios.

Changes Made

  • Added a <pre class="example"> block with a Fetch API usage example.
  • Assigned a unique id="example-x-content-type-options" for Bikeshed validation.
  • Placed the example before the ABNF definition, following standard spec structure.

Checklist (N/A for This PR)

Since this is an editorial change, some checklist items are not applicable:

  • At least two implementers are interested (N/A: Editorial Example)
  • Tests are written (N/A: No functionality changes)
  • Implementation bugs are filed (N/A: No browser changes)
  • MDN issue is filed (Can be considered after PR merge)
  • The commit message is clear

This PR is purely editorial, and no implementation changes are needed. Happy to adjust if maintainers have feedback! 🚀


Preview | Diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant