httphi router refactor (#176)

* httphi: RouterConfig refactor to enable DefaultRouterConfig

* RequestHeader not case sensitive anymore

* httphi: use DefaultRouterConfig in examples

* httphi: remove gated stage complexity

Misusing Stage methods by calling them once header has been written is totally harmless as far as I can tell. We simplify the codebase on this occasion by removing the headerWritten check for all stage methods

* httphi: improve APIs

* httphi: remove status
This commit is contained in:
Pat Whittingslow
2026-08-03 19:33:43 -03:00
committed by GitHub
parent 4517010070
commit d05cd14018
15 changed files with 428 additions and 150 deletions
+1 -5
View File
@@ -3,7 +3,7 @@ package httphi
// StatusText returns a text for the HTTP status code. It returns the empty
// string if the code is unknown.
func StatusText(code int) string {
switch status(code) {
switch code {
case StatusContinue:
return "Continue"
case StatusSwitchingProtocols:
@@ -133,10 +133,6 @@ func StatusText(code int) string {
}
}
const ()
type status int
// HTTP status codes as registered with IANA.
// See: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
const (