Feat: finish putImageAliases
This commit is contained in:
@@ -2,7 +2,9 @@ package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"gitea.konchin.com/go2025/backend/middlewares"
|
||||
"gitea.konchin.com/go2025/backend/utils"
|
||||
"github.com/uptrace/bunrouter"
|
||||
)
|
||||
@@ -19,5 +21,14 @@ import (
|
||||
func (self *Handlers) PostImage(
|
||||
w http.ResponseWriter, req bunrouter.Request,
|
||||
) error {
|
||||
typeHeader := strings.Split(req.Header.Get("Content-Type"), "/")
|
||||
if len(typeHeader) != 2 || typeHeader[0] != "image" {
|
||||
return middlewares.HTTPError{
|
||||
StatusCode: http.StatusBadRequest,
|
||||
Message: "incorrect 'Content-Type' header",
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
return utils.Success(w)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user