GitHub API Compliance (& linting)

This commit is contained in:
Kim "BKC" Carlbäcker 2016-10-07 19:17:27 +02:00
parent 71bb6df75a
commit e6cfccdd40
5 changed files with 61 additions and 9 deletions

View file

@ -35,6 +35,9 @@ func SignedInID(ctx *macaron.Context, sess session.Store) int64 {
// Check access token.
if IsAPIPath(ctx.Req.URL.Path) {
tokenSHA := ctx.Query("token")
if len(tokenSHA) <= 0 {
tokenSHA = ctx.Query("access_token")
}
if len(tokenSHA) == 0 {
// Well, check with header again.
auHead := ctx.Req.Header.Get("Authorization")