Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishal Tak <vtak@gitlab.com>2022-06-20 15:11:36 +0300
committerVishal Tak <vtak@gitlab.com>2022-06-20 15:56:32 +0300
commitca6db0ba6ba8b85d064b4bc3fe89795e78496df8 (patch)
tree9e44fe14f6e23a87a796366053c26ea3d53c8130 /internal/redirects/validations.go
parent24344cc0b0c24e16939a93a610dc09eacece6deb (diff)
Fix domain level redirectsfix-redirects
Do not allow domain level redirects through special characters Changelog: fixed
Diffstat (limited to 'internal/redirects/validations.go')
-rw-r--r--internal/redirects/validations.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/redirects/validations.go b/internal/redirects/validations.go
index 5264f731..ed022f52 100644
--- a/internal/redirects/validations.go
+++ b/internal/redirects/validations.go
@@ -28,7 +28,8 @@ func validateURL(urlText string) error {
// No support for domain-level redirects to outside sites:
// - `https://google.com`
// - `//google.com`
- if url.Host != "" || url.Scheme != "" {
+ // - `/\google.com`
+ if url.Host != "" || url.Scheme != "" || strings.HasPrefix(url.Path, "/\\") {
return errNoDomainLevelRedirects
}