Allow customize how HTTP errors are rendered when `websocket.Accept` fails to upgrade
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- go
- Ambito
- backend-api-design, networking
Direzione di ricerca
Inizia da websocket.Accept e websocket.AcceptOptions e analizza la rappresentazione degli errori HTTP attualmente utilizzata quando l’upgrade non riesce. Definisci il comportamento configurabile per la rappresentazione degli errori mantenendo il comportamento predefinito esistente, quindi verifica che i chiamanti possano produrre la risposta di errore JSON richiesta e distinguere gli errori come descritto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
IDEA: Might be as simple as a new HttpErrorRenderer (or OnError, etc.) option added to websocket.AcceptOptions. When unspecified, default to a fn that implements current rendering behavior. It would take at minimum a ctx, the err and the http status code.
Nice addition: the full set of errors.New("..") would be exposed to user so that one can use errors.Is to get more granularity than provided http statuses.
We need this feature in order to produce https://www.rfc-editor.org/rfc/rfc9457.html (a standardized JSON error response format) when an error occurs in order to match the rest of our API which produces this error response format for all of its endpoints. Current hard-coded behavior prevents us to comply with our policy when WS upgrade fails in this library. Our user thus can't systematically assume this nice JSON format and must workaround this limitation...
- Lingua principale
- Go
- Stelle
- 5.5k
- Fork
- 377
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/websocket
-
Must not wrap io.EOF Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
export wstest Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
Tutte le issue di coder/websocket
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
bug group: validation priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
codecheckers/chekhov#51 ·
-
Creating worktree from an existing remote branch with a slash in it, has unexpected behaviour Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100