Giter VIP home page Giter VIP logo

Comments (4)

EkkoG avatar EkkoG commented on May 16, 2024 1

For sometimes, space encode to +, as Wikipedia says, https://www.wikiwand.com/en/Percent-encoding#The_.60application.2Fx-www-form-urlencoded.60_type

for these cases, it needs an option to replace the plus to space, but it should work in the beginning, e.g. before [[NSURLComponents alloc] initWithString:@"http://example.com/issue?p=a"], and this change will avoid replacing the %2B to space, because %2B raw value is +, after decode, it should also be +,not space.

Also, from RFC 3986, + is a remaining character, for most cases space will be encoded to %20, not plus, so I think setShouldDecodePlusSymbols: default value should be NO, not YES.

Thanks.

@joeldev

from jlroutes.

joeldev avatar joeldev commented on May 16, 2024

Thanks for this as well. A few things:

  1. %2F (/) will not be supported at this time due to the NSURL pathComponents issue you mention.
  2. %2B (+) is now supported by calling [JLRoutes setShouldDecodePlusSymbols:NO];

The reason 2 has been solved with a setting is that I don't believe most people actually want to get the raw + in the resulting variable. For those that do, they can ask JLRoutes not to decode plus symbols and the value will come through as expected.

from jlroutes.

isaaclimdc avatar isaaclimdc commented on May 16, 2024

What if I needed %2F to be supported? What should I do?

from jlroutes.

EkkoG avatar EkkoG commented on May 16, 2024

From w3c ASCII Encoding Reference, the plus(+) encode to %2B, space encode to 20%, as setShouldDecodePlusSymbols: default option, NSURLComponents decode %2B to +, setShouldDecodePlusSymbols: replace the + symbols to space, it more like a bug, %2B shoult never decode to space.

from jlroutes.

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.