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:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-04-28 23:37:02 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-04-28 23:37:02 +0300
commit525b9a33476e97f5a2a006cb4e4ff7959722d467 (patch)
tree9e90a2dc32c008ecfa50155ffd4ecbcba0a16f8f /domain.go
parentb0ac2a7d3f7c48702120de4910cde34b7aee7bdd (diff)
Add helper for checking if path ends with Slash
Diffstat (limited to 'domain.go')
-rw-r--r--domain.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/domain.go b/domain.go
index e274e274..46f57ed0 100644
--- a/domain.go
+++ b/domain.go
@@ -112,7 +112,7 @@ func (d *domain) checkPath(w http.ResponseWriter, r *http.Request, path string)
switch {
// If the URL doesn't end with /, send location to client
- case fi.IsDir() && !strings.HasSuffix(r.URL.Path, "/"):
+ case fi.IsDir() && !endsWithSlash(r.URL.Path):
newURL := *r.URL
newURL.Path += "/"
http.Redirect(w, r, newURL.String(), 302)