summaryrefslogtreecommitdiffstats
path: root/api/context.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-25 09:51:27 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-25 09:51:27 -0700
commit08a343c37288635ba836db41ffd8529209a88fa5 (patch)
tree1faa1d79f7a2a8e3970752c9ec90b5ab9da777d9 /api/context.go
parentf75475d3d053b6f9c4f28de2823302f439f3aec3 (diff)
downloadchat-08a343c37288635ba836db41ffd8529209a88fa5.tar.gz
chat-08a343c37288635ba836db41ffd8529209a88fa5.tar.bz2
chat-08a343c37288635ba836db41ffd8529209a88fa5.zip
Fixing 1 more case
Diffstat (limited to 'api/context.go')
-rw-r--r--api/context.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/api/context.go b/api/context.go
index f123d8702..d90fbd9ee 100644
--- a/api/context.go
+++ b/api/context.go
@@ -459,7 +459,13 @@ func RenderWebError(err *model.AppError, w http.ResponseWriter, r *http.Request)
props := make(map[string]string)
props["Message"] = err.Message
props["Details"] = err.DetailedError
- props["SiteURL"] = GetProtocol(r) + "://" + r.Host
+
+ pathParts := strings.Split(r.URL.Path, "/")
+ if len(pathParts) > 1 {
+ props["SiteURL"] = GetProtocol(r) + "://" + r.Host + "/" + pathParts[1]
+ } else {
+ props["SiteURL"] = GetProtocol(r) + "://" + r.Host
+ }
w.WriteHeader(err.StatusCode)
ServerTemplates.ExecuteTemplate(w, "error.html", Page{Props: props, ClientProps: utils.ClientProperties})