Closed (fixed)
Project:
Decoupled Router
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 May 2020 at 06:09 UTC
Updated:
8 Sep 2025 at 17:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
johnennew commentedRemoving the status check appears to work for me, I expect it will need some more work.
Comment #3
nils.destoop commentedI had the same issue. Attached a patch that fixes it for me. No need to do the routermatch for external urls. If you have a redirect https://myredirect.com/ , the routematch returns the homepage.
Comment #4
nils.destoop commentedUpdated patch for the 2.x version
Comment #5
ankithashettyThe patch in #4 is empty, so rerolled the patch in #3 against latest 2.x version.
Thanks!
Comment #6
ahmad-alyasaki commentedThe problem happened again to me, it's fixed with Patch Number 3, we need to first check if the URL is external. There's no need to send an external path to the Route service, For example, "mysite.com/media/news" would redirect to "example.com/news" if there's a route for "/news" in Drupal the Route service will redirect users to the same domain, ignoring the external path, That's why it's crucial to check if the path is external first. If it's not external, we can then send it to the route match. If there's no resource, just return a 404 status code.
Comment #7
jeffschulerKeep the
returnafter finding an external URL, otherwise the path will continue to be parsed and (depending on the structure of the URL) not always end up including the $redirects_trace (from,to, andstatus) information.Reverted back to the original comment because I believe it's more informative and correct than what it was recently changed to.
Comment #8
dysproseum commentedUpdated patch to apply to 2.0.5.
Comment #9
krystalcode commentedChanges:
- The
returnas pointed out in #7.- Added
isExternal, I think it's useful for clients.- Added
isHomePageas well for consistency.- Minor optimization when creating the path.
- Setting the status code when
ResourceNotFoundExceptionoccurs is not needed, it's already 404 set inPathTranslatorEventComment #12
mglamanLGTM!
Comment #14
mglamanThanks, all!