make the "raw" handlers a bit more consistent

also, todo: think about deleting them
This commit is contained in:
sentriz
2020-04-25 03:17:50 +01:00
parent 56a39126ec
commit 295bf5677f
3 changed files with 9 additions and 5 deletions

View File

@@ -82,6 +82,7 @@ func writeResp(w http.ResponseWriter, r *http.Request, resp *spec.Response) erro
}
type handlerSubsonic func(r *http.Request) *spec.Response
type handlerSubsonicRaw func(w http.ResponseWriter, r *http.Request) *spec.Response
func (c *Controller) H(h handlerSubsonic) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -96,8 +97,6 @@ func (c *Controller) H(h handlerSubsonic) http.Handler {
})
}
type handlerSubsonicRaw func(w http.ResponseWriter, r *http.Request) *spec.Response
func (c *Controller) HR(h handlerSubsonicRaw) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
response := h(w, r)