Save access on plugin env during ServePluginPublicRequest (#16854)
* Save access on plugin env during ServePluginPublicRequest * Cover solution with the offending specs * Apply PR suggestions Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -89,7 +89,15 @@ func (a *App) ServePluginPublicRequest(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
pluginID := vars["plugin_id"]
|
||||
|
||||
publicFilesPath, err := a.GetPluginsEnvironment().PublicFilesPath(pluginID)
|
||||
pluginsEnv := a.GetPluginsEnvironment()
|
||||
|
||||
// Check if someone has nullified the pluginsEnv in the meantime
|
||||
if pluginsEnv == nil {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
publicFilesPath, err := pluginsEnv.PublicFilesPath(pluginID)
|
||||
if err != nil {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
|
||||
Ссылка в новой задаче
Block a user