summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorAsaad Mahmood <Unknowngi@live.com>2015-09-25 22:44:55 +0500
committerAsaad Mahmood <Unknowngi@live.com>2015-09-25 22:44:55 +0500
commit4667d8c61e458f9f24690fd766e7beb8887c84ce (patch)
treef9a125f7c9fd29027064299b9ea5c90aed1ee5af /api
parent9d1dddb7f4cd6ee9682bb48d88f5f0271a72dcba (diff)
parent73cdee70d7bcba367ff006ce1ce6a6d50ccbf3e7 (diff)
downloadchat-4667d8c61e458f9f24690fd766e7beb8887c84ce.tar.gz
chat-4667d8c61e458f9f24690fd766e7beb8887c84ce.tar.bz2
chat-4667d8c61e458f9f24690fd766e7beb8887c84ce.zip
Merge branch 'master' of https://github.com/mattermost/platform into plt-366
Diffstat (limited to 'api')
-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})