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.
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
46f969e5dd
Коммит
dd35ad43ca
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user