mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-14 11:11:35 +00:00
Return status 415 Unsupported Media Type in PUT handler.
Before this commit, an unparseable media type would return 200 OK.
This commit is contained in:
@@ -185,7 +185,8 @@ func putPage(w http.ResponseWriter, r *http.Request) error {
|
||||
|
||||
contentType, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("parsing content type: %w", err)
|
||||
http.Error(w, "malformed content type", http.StatusUnsupportedMediaType)
|
||||
return fmt.Errorf("content type: %w", err)
|
||||
}
|
||||
|
||||
if contentType == "application/x-www-form-urlencoded" {
|
||||
|
||||
Reference in New Issue
Block a user