mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Remove the 'Content-Type' request header requirement (#1834)
This commit is contained in:
parent
a9faa1bc44
commit
d6e9b7b307
1 changed files with 0 additions and 7 deletions
|
@ -237,13 +237,6 @@ func (r *uploadRequest) Validate(maxFileSizeBytes config.FileSizeBytes) *util.JS
|
||||||
if maxFileSizeBytes > 0 && r.MediaMetadata.FileSizeBytes > types.FileSizeBytes(maxFileSizeBytes) {
|
if maxFileSizeBytes > 0 && r.MediaMetadata.FileSizeBytes > types.FileSizeBytes(maxFileSizeBytes) {
|
||||||
return requestEntityTooLargeJSONResponse(maxFileSizeBytes)
|
return requestEntityTooLargeJSONResponse(maxFileSizeBytes)
|
||||||
}
|
}
|
||||||
// TODO: Check if the Content-Type is a valid type?
|
|
||||||
if r.MediaMetadata.ContentType == "" {
|
|
||||||
return &util.JSONResponse{
|
|
||||||
Code: http.StatusBadRequest,
|
|
||||||
JSON: jsonerror.Unknown("HTTP Content-Type request header must be set."),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if strings.HasPrefix(string(r.MediaMetadata.UploadName), "~") {
|
if strings.HasPrefix(string(r.MediaMetadata.UploadName), "~") {
|
||||||
return &util.JSONResponse{
|
return &util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
|
|
Loading…
Reference in a new issue