Skip to content

Commit

Permalink
allow uploading of files without content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
stv0g committed Apr 4, 2022
1 parent af47af0 commit b7d912a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/handlers/initiate.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func HandleInitiate(c *gin.Context) {
return
}

if req.Type == "" {
req.Type = "binary/octet-stream"
}
if _, _, err := mime.ParseMediaType(req.Type); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid type"})
return
Expand Down

0 comments on commit b7d912a

Please sign in to comment.