correct? status codes
Cette révision appartient à :
Parent
42c79c2794
révision
19444c763f
2 fichiers modifiés avec 3 ajouts et 3 suppressions
|
@ -97,7 +97,7 @@ func ApiViewHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
func ApiUploadHandler(w http.ResponseWriter, r *http.Request) {
|
func ApiUploadHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
if config.UploadsDisabled {
|
if config.UploadsDisabled {
|
||||||
http.Error(w, "Error uploads are disabled", http.StatusInternalServerError)
|
http.Error(w, "Error uploads are disabled", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,11 +146,11 @@ func (r *TorrentRequest) ValidateMultipartUpload(req *http.Request) (int64, erro
|
||||||
}
|
}
|
||||||
// check a few things
|
// check a few things
|
||||||
if torrent.IsPrivate() {
|
if torrent.IsPrivate() {
|
||||||
return 0, errors.New("private torrents not allowed"), http.StatusBadRequest
|
return 0, errors.New("private torrents not allowed"), http.StatusNotAcceptable
|
||||||
}
|
}
|
||||||
trackers := torrent.GetAllAnnounceURLS()
|
trackers := torrent.GetAllAnnounceURLS()
|
||||||
if !uploadService.CheckTrackers(trackers) {
|
if !uploadService.CheckTrackers(trackers) {
|
||||||
return 0, errors.New("tracker(s) not allowed"), http.StatusBadRequest
|
return 0, errors.New("tracker(s) not allowed"), http.StatusNotAcceptable
|
||||||
}
|
}
|
||||||
if r.Name == "" {
|
if r.Name == "" {
|
||||||
r.Name = torrent.TorrentName()
|
r.Name = torrent.TorrentName()
|
||||||
|
|
Référencer dans un nouveau ticket