Content-Length rejection if specified larger than allowed size.

This commit is contained in:
ZizzyDizzyMC 2021-02-21 20:40:10 -05:00
parent 9d9f5b3a69
commit b8f4b55f05
1 changed files with 5 additions and 0 deletions

View File

@ -228,6 +228,11 @@ func uploadRemote(c web.C, w http.ResponseWriter, r *http.Request) {
} }
func uploadHeaderProcess(r *http.Request, upReq *UploadRequest) { func uploadHeaderProcess(r *http.Request, upReq *UploadRequest) {
if len(r.Header.Get("Content-Length") > 0 {
if r.Header.Get("Content-Length") > Config.maxSize {
upReq.size = r.Header.Get("Content-Length")
}
}
if r.Header.Get("Linx-Randomize") == "yes" { if r.Header.Get("Linx-Randomize") == "yes" {
upReq.randomBarename = true upReq.randomBarename = true
} }