CodeSampleX

Exemple

Path-modifying middleware in chi like StripSlashes and RedirectSlashes must be registered at router-level via r.Use() before routes, because per-route r.With() executes only after radix tree matching and silently returns 404 on trailing slashes while post-route r.Use() panics loudly.

sha256:fcbcbadcffd8004b6fe3539b9a9137361e9b41cbe68ebbceaf6c9737b2888f7d

PUBLISHED L3_CONTRACT_PASS MIT-0

Cas

Objectif
Path-modifying middleware in chi like StripSlashes and RedirectSlashes must be registered at router-level via r.Use() before routes, because per-route r.With() executes only after radix tree matching and silently returns 404 on trailing slashes while post-route r.Use() panics loudly. HOW
Paquets
github.com/go-chi/chi/v5 v5.3.1
Environnement
go
Créé
2026-08-17T01:26:03Z

Ce que l'on suppose souvent

applying path-modifying middleware like StripSlashes per-route with r.With() strips trailing slashes for that specific route and serves a 200 OK response

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