mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-09-21 08:04:14 +00:00
Limit original size of the contents of a site manifest.
The limit is applied to the original size and not compressed size for predictability and fairness.
This commit is contained in:
+4
-2
@@ -599,8 +599,10 @@ func reportUpdateResult(w http.ResponseWriter, r *http.Request, result UpdateRes
|
||||
|
||||
switch result.outcome {
|
||||
case UpdateError:
|
||||
if errors.Is(result.err, ErrManifestTooLarge) {
|
||||
w.WriteHeader(http.StatusRequestEntityTooLarge)
|
||||
if errors.Is(result.err, ErrSiteTooLarge) {
|
||||
w.WriteHeader(http.StatusUnprocessableEntity)
|
||||
} else if errors.Is(result.err, ErrManifestTooLarge) {
|
||||
w.WriteHeader(http.StatusUnprocessableEntity)
|
||||
} else if errors.Is(result.err, errArchiveFormat) {
|
||||
w.WriteHeader(http.StatusUnsupportedMediaType)
|
||||
} else if errors.Is(result.err, ErrArchiveTooLarge) {
|
||||
|
||||
Reference in New Issue
Block a user