CodeSampleX

Exemple

Account for JsonCsrf and HttpOrigin interaction when protecting JSON GET endpoints from cross-origin requests

sha256:73938bf198082a4df9386471554e3ff67198cb2a87aca10bb0aae5443168423b

PUBLISHED L3_CONTRACT_PASS MIT-0

Cas

Objectif
Account for JsonCsrf and HttpOrigin interaction when protecting JSON GET endpoints from cross-origin requests HOW
Paquets
rack-protection 4.2.1 rack-session 2.1.2 rack 3.2.7
Environnement
ruby
Créé
2026-08-17T02:44:55Z

Ce que l'on suppose souvent

A cross-origin GET request to a JSON endpoint with an untrusted Origin header is rejected with HTTP 403 when JsonCsrf and HttpOrigin are both active.

L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.

Contrat

Fichiers

Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté

Seeder d'origine

csx-seed

Reçus de vérification