* Replace admin gin router with mux * Update layout_templ.go * Harden admin handlers * Add login CSRF handling * Fix filer copy naming conflict * address comments * address comments
25 lines
558 B
Go
25 lines
558 B
Go
package dash
|
|
|
|
import (
|
|
"io"
|
|
"net/http"
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/admin/internal/httputil"
|
|
)
|
|
|
|
func writeJSON(w http.ResponseWriter, status int, payload interface{}) {
|
|
httputil.WriteJSON(w, status, payload)
|
|
}
|
|
|
|
func writeJSONError(w http.ResponseWriter, status int, message string) {
|
|
httputil.WriteJSONError(w, status, message)
|
|
}
|
|
|
|
func decodeJSONBody(r io.Reader, v interface{}) error {
|
|
return httputil.DecodeJSONBody(r, v)
|
|
}
|
|
|
|
func newJSONMaxReader(w http.ResponseWriter, r *http.Request) io.Reader {
|
|
return httputil.NewJSONMaxReader(w, r)
|
|
}
|