Finalize repair
This commit is contained in:
19
internal/http/util.go
Normal file
19
internal/http/util.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user