Fix error videos
This commit is contained in:
@@ -39,13 +39,13 @@ func HandleDirectoryListing(w http.ResponseWriter, r *http.Request, t *torrent.T
|
||||
output, err = handleSingleTorrent(requestPath, w, r, t)
|
||||
default:
|
||||
log.Errorf("Request %s %s not found", r.Method, requestPath)
|
||||
writeHTTPError(w, "Not Found", http.StatusNotFound)
|
||||
http.Error(w, "Not Found", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Error processing request: %v", err)
|
||||
writeHTTPError(w, "Server error", http.StatusInternalServerError)
|
||||
http.Error(w, "Server error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func writeHTTPError(w http.ResponseWriter, errorMessage string, statusCode int) {
|
||||
http.Error(w, errorMessage, statusCode)
|
||||
}
|
||||
|
||||
func removeEmptySegments(urlSegments []string) []string {
|
||||
var result []string
|
||||
for _, s := range urlSegments {
|
||||
|
||||
Reference in New Issue
Block a user