Skip to content

Error in OAuth2Ex.HTTP.decode_body #10

@optikfluffel

Description

@optikfluffel

Hi, I'm using oauth2ex with the SoundCloud API. When I get a unauthorised answer with headers that look like this:

[
  {"Access-Control-Allow-Headers", "Accept, Authorization, Content-Type, Origin"}, 
  {"Access-Control-Allow-Methods", "GET, PUT, POST, DELETE"},
  {"Access-Control-Allow-Origin", "*"}, 
  {"Access-Control-Expose-Headers", "Date"},
  {"Cache-Control", "no-cache"},
  {"Content-Type", "application/json; charset=utf-8"},
  {"Date", "Sat, 25 Jul 2015 07:19:48 GMT"},
  {"Server", "am/2"},
  {"Status", "401 Unauthorized"},
  {"Content-Length", "51"}
]

I get an exception:

** (exit) an exception was raised:
    ** (ArgumentError) the access protocol for lists expect the key to be an atom, got: "Content-Type"
        (elixir) lib/access.ex:56: Access.List.get/2
        (oauth2ex) lib/oauth2ex/http.ex:72: OAuth2Ex.HTTP.decode_body/1
        (oauth2ex) lib/oauth2ex/http.ex:59: OAuth2Ex.HTTP.request/6

Am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions