mirror of
https://github.com/restic/rest-server.git
synced 2026-04-14 14:11:38 -07:00
Reply "insufficient storage" on disk full or over-quota
This commit will change the current behavior on disk-related errors: * HTTP 507 "Insufficient storage" is the status on disk full or over-quota * HTTP 500 "Internal server error" on other disk-related errors previously both were 400 "Bad request"
This commit is contained in:
@@ -75,7 +75,7 @@ func (m *Manager) WrapWriter(req *http.Request, w io.Writer) (io.Writer, int, er
|
||||
if currentSize+contentLen > m.maxRepoSize {
|
||||
err := fmt.Errorf("incoming blob (%d bytes) would exceed maximum size of repository (%d bytes)",
|
||||
contentLen, m.maxRepoSize)
|
||||
return nil, http.StatusRequestEntityTooLarge, err
|
||||
return nil, http.StatusInsufficientStorage, err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user