Topic

[API] Bad key results in empty response

api.glitch.com/simple/skill... used to respond with {"ok":0,"error":"not_authorized"} but now responds with an empty body. Same applies for other forms of invalid key, it seems.

Posted 19 months ago by Taral Subscriber! | Permalink

Replies

  • Okay, I tracked this down.

    api.glitch.com/simple/auth.... returns:

    HTTP/1.1 200 OK
    Access-Control-Allow-Credentials: false
    Access-Control-Allow-Methods: POST, GET, OPTIONS
    Access-Control-Allow-Origin: *
    Access-Control-Max-Age: 1728000
    Content-Type: text/plain
    Date: Wed, 08 Jun 2011 02:12:36 GMT
    Server: Apache/2.2.17
    Content-Length: 36
    Connection: Close

    {"ok":0,"error":"not_authenticated"}

    But http://api.glitch.com/simple/auth.check?oauth_token=x returns:

    HTTP/1.1 401 Unauthorized
    Access-Control-Allow-Credentials: false
    Access-Control-Allow-Methods: POST, GET, OPTIONS
    Access-Control-Allow-Origin: *
    Access-Control-Max-Age: 1728000
    Content-Type: text/html
    Date: Wed, 08 Jun 2011 02:13:12 GMT
    Server: Apache/2.2.17
    WWW-Authenticate: Token realm='glitch', error='invalid_token'
    Content-Length: 0
    Connection: Close

    Why am I getting a 401?
    Posted 18 months ago by Taral Subscriber! | Permalink
  • this is now fixed. there was some left-over error handling code from when the API used OAuth version 1. it now responds with OAuth-2 style error messages as you expect
    Posted 18 months ago by Bees! Subscriber! | Permalink