MM-59283: Minor improvement in getClientConfig (#27825)
Overall, there is no bug here. But opportunities for improvement. - Used the maps.Clone function. - Handled the error while writing to the network. https://mattermost.atlassian.net/browse/MM-59283 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
50ebf8cc13
Коммит
28939d84da
@@ -258,7 +258,9 @@ func getClientConfig(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
config = c.App.Srv().Platform().ClientConfigWithComputed()
|
||||
}
|
||||
|
||||
w.Write([]byte(model.MapToJSON(config)))
|
||||
if err := json.NewEncoder(w).Encode(config); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func getEnvironmentConfig(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Ссылка в новой задаче
Block a user