Use cmap for infos

This commit is contained in:
2024-02-19 00:47:25 +01:00
parent 2afed432f7
commit f54a876636
5 changed files with 53 additions and 26 deletions

View File

@@ -23,6 +23,10 @@ func GetPath(c echo.Context) (string, error) {
return key, nil
}
func GetRoute(c echo.Context) string {
return c.Request().Header.Get("X-Route")
}
func SanitizePath(path string) error {
if strings.Contains(path, "/") || strings.Contains(path, "..") {
return echo.NewHTTPError(http.StatusBadRequest, "Invalid parameter. Can't contains path delimiters or ..")