mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 19:42:49 +08:00
Chore: pass url parameters through context.Context (#38826)
* pass url parameters through context.Context * fix url param names without colon prefix * change context params to vars * replace url vars in tests using new api * rename vars to params * add some comments * rename seturlvars to seturlparams
This commit is contained in:
@ -13,6 +13,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/ldap"
|
||||
"github.com/grafana/grafana/pkg/services/multildap"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
macaron "gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -238,7 +239,7 @@ func (hs *HTTPServer) GetUserFromLDAP(c *models.ReqContext) response.Response {
|
||||
|
||||
ldap := newLDAP(ldapConfig.Servers)
|
||||
|
||||
username := c.Params(":username")
|
||||
username := macaron.Params(c.Req)[":username"]
|
||||
|
||||
if len(username) == 0 {
|
||||
return response.Error(http.StatusBadRequest, "Validation error. You must specify an username", nil)
|
||||
|
Reference in New Issue
Block a user