Testing auth UNDO BEFORE DEPLOY
This commit is contained in:
parent
a3e7e2afc0
commit
ed85d11d96
|
@ -40,6 +40,9 @@ func AdminAtomFeed(c *RequestContext) ResponseData {
|
||||||
creds := fmt.Sprintf("%s:%s", config.Config.Admin.AtomUsername, config.Config.Admin.AtomPassword)
|
creds := fmt.Sprintf("%s:%s", config.Config.Admin.AtomUsername, config.Config.Admin.AtomPassword)
|
||||||
expectedAuth := fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(creds)))
|
expectedAuth := fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(creds)))
|
||||||
auth, hasAuth := c.Req.Header["Authorization"]
|
auth, hasAuth := c.Req.Header["Authorization"]
|
||||||
|
if hasAuth {
|
||||||
|
c.Logger.Warn().Str("auth", auth[0]).Msg("Got auth")
|
||||||
|
}
|
||||||
if !hasAuth || auth[0] != expectedAuth {
|
if !hasAuth || auth[0] != expectedAuth {
|
||||||
return FourOhFour(c)
|
return FourOhFour(c)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue