Finalize repair

This commit is contained in:
Ben Sarmiento
2023-10-26 03:29:13 +02:00
parent cc9616894a
commit 54ab801796
13 changed files with 500 additions and 517 deletions

19
internal/http/util.go Normal file
View File

@@ -0,0 +1,19 @@
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 {
if s != "" {
result = append(result, s)
}
}
return result
}