[MM-28131] Fix desanitization of DataSourceReplicas and DataSourceSearchReplicas (#15389)
* Fix desanitization of DataSourceReplicas and DataSourceSearchReplicas * Fix test case Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
42657fafa1
Коммит
334cf9d84a
@@ -210,7 +210,7 @@ func patchConfig(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
appCfg := c.App.Config()
|
||||
if *appCfg.ServiceSettings.SiteURL != "" && (cfg.ServiceSettings.SiteURL == nil || *cfg.ServiceSettings.SiteURL == "") {
|
||||
if *appCfg.ServiceSettings.SiteURL != "" && cfg.ServiceSettings.SiteURL != nil && *cfg.ServiceSettings.SiteURL == "" {
|
||||
c.Err = model.NewAppError("patchConfig", "api.config.update_config.clear_siteurl.app_error", nil, "", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -670,11 +670,9 @@ func TestPatchConfig(t *testing.T) {
|
||||
CheckNoError(t, resp)
|
||||
require.Equal(t, nonEmptyURL, *cfg.ServiceSettings.SiteURL)
|
||||
|
||||
// Check that sending an empty config returns an error.
|
||||
// Check that sending an empty config returns no error.
|
||||
_, resp = th.SystemAdminClient.PatchConfig(&model.Config{})
|
||||
require.NotNil(t, resp.Error)
|
||||
CheckBadRequestStatus(t, resp)
|
||||
assert.Equal(t, "api.config.update_config.clear_siteurl.app_error", resp.Error.Id)
|
||||
CheckNoError(t, resp)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user