summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorJesse Hallam <jesse.hallam@gmail.com>2018-06-21 14:31:51 -0400
committerChristopher Speller <crspeller@gmail.com>2018-06-21 11:31:51 -0700
commitdd35ad43caab407cc70ef3b153b3f94d57242ed9 (patch)
tree67afe0fb6ad784e740d8b2a99d5de5c04342661c /cmd
parent46f969e5ddbe4404dbc82dbe78ab2fa101d9922e (diff)
downloadchat-dd35ad43caab407cc70ef3b153b3f94d57242ed9.tar.gz
chat-dd35ad43caab407cc70ef3b153b3f94d57242ed9.tar.bz2
chat-dd35ad43caab407cc70ef3b153b3f94d57242ed9.zip
MM-10370: serve subpath (#8968)
* factor out GetSubpathFromConfig * mv web/subpath.go to utils/subpath.go * serve up web, api and ws on /subpath if configured * pass config to utils.RenderWeb(App)?Error This allows the methods to extract the configured subpath and redirect to the appropriate `/subpath/error` handler. * ensure GetSubpathFromConfig returns trailing slashes deterministically * fix error 404 handling * redirect /subpath to /subpath/ This is necessary for the static handler to match, otherwise none of the registered routes find anything. This also makes it no longer necessary to add trailing slashes in the root router.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mattermost/commands/config.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/mattermost/commands/config.go b/cmd/mattermost/commands/config.go
index 0b0e00f35..d9881b050 100644
--- a/cmd/mattermost/commands/config.go
+++ b/cmd/mattermost/commands/config.go
@@ -12,7 +12,6 @@ import (
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/utils"
- "github.com/mattermost/mattermost-server/web"
)
var ConfigCmd = &cobra.Command{
@@ -92,8 +91,8 @@ func configSubpathCmdF(command *cobra.Command, args []string) error {
if err != nil {
return errors.Wrap(err, "failed reading path")
} else if path == "" {
- return web.UpdateAssetsSubpathFromConfig(a.Config())
- } else if err := web.UpdateAssetsSubpath(path); err != nil {
+ return utils.UpdateAssetsSubpathFromConfig(a.Config())
+ } else if err := utils.UpdateAssetsSubpath(path); err != nil {
return errors.Wrap(err, "failed to update assets subpath")
}