add MediaLofi in kontor-gin (#97)
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de> Reviewed-on: #97
This commit was merged in pull request #97.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
func StripUrl(webLink string, keepParam string) string {
|
||||
u, err := url.Parse(webLink)
|
||||
if err != nil {
|
||||
slog.Info("StripUrl", "error", err)
|
||||
return webLink
|
||||
}
|
||||
values := u.Query()
|
||||
for key := range values {
|
||||
if key != keepParam {
|
||||
values.Del(key)
|
||||
}
|
||||
}
|
||||
u.RawQuery = values.Encode()
|
||||
return u.String()
|
||||
}
|
||||
Reference in New Issue
Block a user