diff --git a/router/apiHandler.go b/router/apiHandler.go index 557fa5c0..0f684915 100644 --- a/router/apiHandler.go +++ b/router/apiHandler.go @@ -97,7 +97,7 @@ func ApiViewHandler(w http.ResponseWriter, r *http.Request) { func ApiUploadHandler(w http.ResponseWriter, r *http.Request) { if config.UploadsDisabled { - http.Error(w, "Error uploads are disabled", http.StatusInternalServerError) + http.Error(w, "Error uploads are disabled", http.StatusBadRequest) return } diff --git a/service/api/api.go b/service/api/api.go index 78740bb8..3736031c 100644 --- a/service/api/api.go +++ b/service/api/api.go @@ -146,11 +146,11 @@ func (r *TorrentRequest) ValidateMultipartUpload(req *http.Request) (int64, erro } // check a few things 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() 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 == "" { r.Name = torrent.TorrentName()