GithubHelp home page GithubHelp logo

Comments (3)

scrogson avatar scrogson commented on July 24, 2024

Thanks for the report. I don't know the right answer at the moment but I will try to find out.

My gut tells me that the API should handle both. But maybe I need to fix it on my end.

from oauth2.

meatherly avatar meatherly commented on July 24, 2024

@waynehoover how are you specifying your params? I was looking through the docs for URI.encode_query/1 and it looks like it shouldn't encode the + sign. Take a look and tell me if you're seeing the same thing https://github.com/elixir-lang/elixir/blob/v1.1.1/lib/elixir/lib/uri.ex#L61

from oauth2.

waynehoover avatar waynehoover commented on July 24, 2024

@meatherly the query string is getting passed via options to OAuth.authoriz_url! as a string like "foo+bar+baz" which in turn produces this:

iex(2)> URI.encode_query(scope: "foo+bar+baz")
"scope=foo%2Bbar%2Bbaz"

Also reading the source I think I understand why + is escaped, because + is somewhat a special character in URIs, it is being used to represent spaces in urls, as you can see %20 i.e. space is being replaced by "+" manually https://github.com/elixir-lang/elixir/blob/v1.1.1/lib/elixir/lib/uri.ex#L191

For example:

iex(4)> URI.encode_query(param: "foo bar+baz")
"param=foo+bar%2Bbaz"

So this means to answer my original question and possibly close this ticket, if I pass scope: "foo baz" to OAuth.authorize_url! I will get what I want, i.e. + separated list. @scrogson feel free to close.

from oauth2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.