Skip to content

Fixes DPLRouteMatcher Incorrectly Matching URL Without Host or Path #115

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

Closed

Conversation

mliberatore
Copy link
Contributor

Closes #114

See details at #114. This prevents a URL with just a scheme from being matched to a route that has a single variable. The example given at #114 is the following route registration:

self.router[@":log_message"] = ^(DPLDeepLink *link) {
    NSLog(@"%@", link[@"log_message"]);
};

This should properly log hello for the URL dpl://hello in the ReceiverDemo sample project. The block, however, should not execute for dpl://. Before this change, it would execute and log the string (null)(null).

Handles `nil` URL `host` and `path` more appropriately.
@button-bot
Copy link

Hi @mliberatore,
Thank you for your Pull Request!

It looks like you haven't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen license.
Wikipedia

Please read and sign our full Contributor License Agreement here.

Once you've signed reply with [clabot:check] to let us know.

Thank you,

ButtonBot

@mliberatore
Copy link
Contributor Author

[clabot:check]

@button-bot
Copy link

@wessmith It looks like @mliberatore just signed our Contributor License Agreement. 👍

ButtonBot

@chrismaddern
Copy link
Contributor

@mliberatore @wessmith I restarted the build -- looked like a tooling error 😢

@chrismaddern chrismaddern modified the milestones: 1.2.0, 1.3.0 Nov 9, 2016
@wessmith
Copy link
Member

Hi @mliberatore. Thanks for this! It looks like there's a lot of errors in the test target. Is that happening locally for you when you run the tests?

@mliberatore
Copy link
Contributor Author

Hi @wessmith and @chrismaddern! I haven’t been able to get the tests to run successfully, even on a clean clone of the repo. Here are the steps I took:

  1. Cloned the repo (or rather, my fork of the repo in which I made the changes for this pull request).
  2. Checked out a new, clean branch from master.
  3. Ran bundle exec pod install from the root directory to install necessary dependencies.
  4. Ran the ReceiverDemo app to ensure everything built.
  5. Ran tests using ⌘+U in Xcode.
  6. Exception occurs in main.m, specifically Thread 1: signal SIGARBT. The trace from the console is below.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AccessibilitySettingsController AXInspectorEnabled:]: unrecognized selector sent to instance 0x7fdc8802b000'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010aaed34b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010a54e21e objc_exception_throw + 48
    2   CoreFoundation                      0x000000010ab5cf34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   CoreFoundation                      0x000000010aa72c15 ___forwarding___ + 1013
    4   CoreFoundation                      0x000000010aa72798 _CF_forwarding_prep_0 + 120
    5   KIF                                 0x0000000114a73024 -[KIFAccessibilityEnabler _enableAccessibility] + 836
    6   KIF                                 0x0000000114a7322c -[KIFAccessibilityEnabler testBundleWillStart:] + 76
    7   XCTest                              0x000000011449dcc6 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 501
    8   XCTest                              0x000000011447c4b5 -[XCTestDriver _runSuite] + 436
    9   XCTest                              0x000000011447d302 -[XCTestDriver _checkForTestManager] + 287
    10  XCTest                              0x00000001144ccd67 _XCTestMain + 628
    11  CoreFoundation                      0x000000010aa9225c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    12  CoreFoundation                      0x000000010aa77304 __CFRunLoopDoBlocks + 356
    13  CoreFoundation                      0x000000010aa76a75 __CFRunLoopRun + 901
    14  CoreFoundation                      0x000000010aa76494 CFRunLoopRunSpecific + 420
    15  GraphicsServices                    0x000000010cfdaa6f GSEventRunModal + 161
    16  UIKit                               0x00000001087c6964 UIApplicationMain + 159
    17  ReceiverDemo                        0x0000000107fc48ff main + 111
    18  libdyld.dylib                       0x000000010c05268d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

So to be clear, this is without my changes from this pull request. Please let me know if you need any further information, or if you could provide me with other steps in order to get the tests running properly.

Also note I’m running Xcode 8.1 (8B62) on macOS Sierra 10.12.1. I’m attempting to run the tests using ⌘+U in Xcode with the iPhone 6s 10.1 simulator.

@wessmith
Copy link
Member

triage: needs to be rebased onto master and tests to support the change

@mliberatore would you like to update this PR or want us to take it on?

@mliberatore
Copy link
Contributor Author

Hi @wessmith, thanks for taking a look. I’d sincerely appreciate it if you could take it on 🙂

@wessmith wessmith mentioned this pull request May 31, 2019
@wessmith
Copy link
Member

Merged in #152

@wessmith wessmith closed this May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

DPLRouteMatcher Incorrectly Matches URL Without Host or Path
4 participants