Update README.md

This commit is contained in:
ishanray 2016-03-05 02:27:19 +04:00
parent 3d002e3823
commit 19f77bdd4c

View File

@ -583,7 +583,7 @@ func main() {
// /admin/secrets endpoint // /admin/secrets endpoint
// hit "localhost:8080/admin/secrets // hit "localhost:8080/admin/secrets
authorized.GET("/secrets", func(c *gin.Context) { authorized.GET("/secrets", func(c *gin.Context) {
// get user, it was setted by the BasicAuth middleware // get user, it was set by the BasicAuth middleware
user := c.MustGet(gin.AuthUserKey).(string) user := c.MustGet(gin.AuthUserKey).(string)
if secret, ok := secrets[user]; ok { if secret, ok := secrets[user]; ok {
c.JSON(http.StatusOK, gin.H{"user": user, "secret": secret}) c.JSON(http.StatusOK, gin.H{"user": user, "secret": secret})