PLT-5900 Removed automatic configuration of SiteURL (#5952)
* Revert "PLT-5765 Passed SiteURL to SendNotifications (#5705)"
This reverts commit a8e68bd890.
* Removed automatic configuration of SiteURL
* Reverted unintentional config changes
* Updated help text
* Added link to docs in Site URL warning
* Fixed merge conflict
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
3a79e451ff
Коммит
c7bdce8a66
@@ -19,14 +19,14 @@ import (
|
||||
)
|
||||
|
||||
type Context struct {
|
||||
Session model.Session
|
||||
Params *ApiParams
|
||||
Err *model.AppError
|
||||
T goi18n.TranslateFunc
|
||||
RequestId string
|
||||
IpAddress string
|
||||
Path string
|
||||
siteURL string
|
||||
Session model.Session
|
||||
Params *ApiParams
|
||||
Err *model.AppError
|
||||
T goi18n.TranslateFunc
|
||||
RequestId string
|
||||
IpAddress string
|
||||
Path string
|
||||
siteURLHeader string
|
||||
}
|
||||
|
||||
func ApiHandler(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler {
|
||||
@@ -125,12 +125,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
isTokenFromQueryString = true
|
||||
}
|
||||
|
||||
if utils.GetSiteURL() == "" {
|
||||
protocol := app.GetProtocol(r)
|
||||
c.SetSiteURL(protocol + "://" + r.Host)
|
||||
} else {
|
||||
c.SetSiteURL(utils.GetSiteURL())
|
||||
}
|
||||
c.SetSiteURLHeader(app.GetProtocol(r) + "://" + r.Host)
|
||||
|
||||
w.Header().Set(model.HEADER_REQUEST_ID, c.RequestId)
|
||||
w.Header().Set(model.HEADER_VERSION_ID, fmt.Sprintf("%v.%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.CfgHash, utils.IsLicensed))
|
||||
@@ -320,12 +315,12 @@ func (c *Context) SetPermissionError(permission *model.Permission) {
|
||||
c.Err.StatusCode = http.StatusForbidden
|
||||
}
|
||||
|
||||
func (c *Context) SetSiteURL(url string) {
|
||||
c.siteURL = strings.TrimRight(url, "/")
|
||||
func (c *Context) SetSiteURLHeader(url string) {
|
||||
c.siteURLHeader = strings.TrimRight(url, "/")
|
||||
}
|
||||
|
||||
func (c *Context) GetSiteURL() string {
|
||||
return c.siteURL
|
||||
func (c *Context) GetSiteURLHeader() string {
|
||||
return c.siteURLHeader
|
||||
}
|
||||
|
||||
func (c *Context) RequireUserId() *Context {
|
||||
|
||||
Ссылка в новой задаче
Block a user