Coder Social home page Coder Social logo

Comments (7)

joeldev avatar joeldev commented on August 20, 2024 1

Sorry for the trouble, everyone. I just reverted the changes made in this commit (e9536fd).

from jlroutes.

abbasmousavi avatar abbasmousavi commented on August 20, 2024

This commit, breaks route matching on iOS 9. @radianttap.
I have comment it out in my code and route matching is working again.

from jlroutes.

zats avatar zats commented on August 20, 2024

We ran into the same issue, our scenario is that we are using router both for external universal links (https://myapp.com/path) and for internal links (myapp://path), also we need to support several environments, so in our case universal links can be https://dev.myapp.com/path or https://staging.myapp.com/path or https://myapp.com/path

Also for universal links we support links opened from emails, e.g. https://email.myapp.com/path and links opened from web, e.g. https://web.myapp.com/path. Currently we are working around it by replacing host with localhost prior to sending it to JLRoutes

I'm not sure I understand the reasoning behind this change, not sure if I've seen other routing solutions to match against the host (similar ruby libraries for example)

from jlroutes.

ekampf avatar ekampf commented on August 20, 2024

Traced back to this commit: 98febf4#diff-49786c8b72bf93a052e6bbaf95b8b295R444

@joeldev is the intended behaviour that route has to contain the host? seems odd...

from jlroutes.

joeldev avatar joeldev commented on August 20, 2024

I'm going to close this issue for now. Please feel free to re-open (or file another issue) if me reverting that commit has caused some other issue. All current tests are passing and I'm always looking to add more.

from jlroutes.

zats avatar zats commented on August 20, 2024

Thank you

from jlroutes.

mjarvis avatar mjarvis commented on August 20, 2024

@joeldev This issue appears to be reoccurring. JLRRouteRequest.m:L33-38 adds the host as a path component. Is this an intentional change for 2.0? It does not match the routing behaviour from the 1.x versions of JLRoutes.

Here is a failing test that indicates this problem:

- (void)testHostIgnored
{
    [[JLRoutes globalRoutes] addRoute:@"/someRoute/123"
                              handler:[[self class] defaultRouteHandler]];

    [self route:@"https://google.com/someRoute/123"];
    JLValidateAnyRouteMatched();
}

If this is intentional, it would be a good idea to document the change in behaviour in the 2.0.0 release notes and possibly a "migrating to 2.x" document, as people will need to add manual stripping of the host to bring back the old behaviour.

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.