feat(smalltrip,problems): http handler for problems (wip)
This commit is contained in:
@@ -3,6 +3,7 @@ package problem
|
||||
import (
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"slices"
|
||||
)
|
||||
|
||||
@@ -43,6 +44,10 @@ func (p Problem) StatusCode() int {
|
||||
return p.Status
|
||||
}
|
||||
|
||||
func (p Problem) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
p.handler(p).ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
func WithType(t string) Option {
|
||||
return func(p *Problem) {
|
||||
p.Type = t
|
||||
|
||||
Reference in New Issue
Block a user