WIP
This commit is contained in:
@@ -64,3 +64,18 @@ func (app *App) handleSignedIn(pattern string, fn handlerFunc) {
|
||||
return fn(s, w, r)
|
||||
})
|
||||
}
|
||||
|
||||
type peerHandlerFunc func(w http.ResponseWriter, r *http.Request) error
|
||||
|
||||
func (app *App) handlePeer(pattern string, fn peerHandlerFunc) {
|
||||
wrapped := func(w http.ResponseWriter, r *http.Request) {
|
||||
r.ParseForm()
|
||||
if err := fn(w, r); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
|
||||
app.mux.HandleFunc(pattern,
|
||||
webutil.WithLogging(
|
||||
wrapped))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user