* Basic plugin context.

* Adding more useful fields to plugin context.

* Fix spelling

Co-Authored-By: crspeller <crspeller@gmail.com>

* Fixing location of context creation.
Этот коммит содержится в:
Christopher Speller
2018-12-05 10:46:08 -08:00
коммит произвёл GitHub
родитель de5440d979
Коммит aba194188f
13 изменённых файлов: 113 добавлений и 34 удалений

Просмотреть файл

@@ -42,7 +42,12 @@ func (a *App) ServePluginRequest(w http.ResponseWriter, r *http.Request) {
func (a *App) servePluginRequest(w http.ResponseWriter, r *http.Request, handler func(*plugin.Context, http.ResponseWriter, *http.Request)) {
token := ""
context := &plugin.Context{}
context := &plugin.Context{
RequestId: model.NewId(),
IpAddress: utils.GetIpAddress(r),
AcceptLanguage: r.Header.Get("Accept-Language"),
UserAgent: r.UserAgent(),
}
cookieAuth := false
authHeader := r.Header.Get(model.HEADER_AUTH)