server(filesystem): handle writing empty files
Fixes https://github.com/pterodactyl/panel/issues/5038 Signed-off-by: Matthew Penner <me@matthewp.io>
This commit is contained in:
@@ -239,7 +239,8 @@ func postServerWriteFile(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if c.Request.ContentLength < 1 {
|
||||
// A content length of -1 means the actual length is unknown.
|
||||
if c.Request.ContentLength == -1 {
|
||||
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{
|
||||
"error": "Missing Content-Length",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user