[MM-34919] Use Mattermost-Plugin-ID header to pass ID in inter-plugin requests (#17418)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4bd6f4942f
Коммит
730dc6b985
@@ -74,6 +74,8 @@ func (a *App) ServeInterPluginRequest(w http.ResponseWriter, r *http.Request, so
|
||||
SourcePluginId: sourcePluginId,
|
||||
}
|
||||
|
||||
r.Header.Set("Mattermost-Plugin-ID", sourcePluginId)
|
||||
|
||||
hooks.ServeHTTP(context, w, r)
|
||||
}
|
||||
|
||||
@@ -135,6 +137,9 @@ func (a *App) servePluginRequest(w http.ResponseWriter, r *http.Request, handler
|
||||
token = r.URL.Query().Get("access_token")
|
||||
}
|
||||
|
||||
// Mattermost-Plugin-ID can only be set by inter-plugin requests
|
||||
r.Header.Del("Mattermost-Plugin-ID")
|
||||
|
||||
r.Header.Del("Mattermost-User-Id")
|
||||
if token != "" {
|
||||
session, err := a.GetSession(token)
|
||||
|
||||
Ссылка в новой задаче
Block a user