Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in OAuth2Ex.HTTP.decode_body #10

Closed
optikfluffel opened this issue Jul 25, 2015 · 1 comment · Fixed by #13
Closed

Error in OAuth2Ex.HTTP.decode_body #10

optikfluffel opened this issue Jul 25, 2015 · 1 comment · Fixed by #13

Comments

@optikfluffel
Copy link
Contributor

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?

@parroty
Copy link
Owner

parroty commented Jul 25, 2015

Thanks for the report. I haven't been able to find specific issue with the posted header.

Can you post your mix.exs and mix.lock file? I couldn't find the direct assiation between oauth2ex master code and the line number which error message is reporting. Also would like to check the HTTPoison version.

mweibel added a commit to mweibel/oauth2ex that referenced this issue Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants