Route matching doesn't handle `%2F` (encoded `/`) as expected
See original GitHub issueCurrent behavior:
cy.route('api/issue*')
doesn’t match XHR request sent to api/issue?param=%2Fpath%2Fto
(where param value is encodeURIComponent('/path/to')
).
Desired behavior:
Properly encoded /
symbol (as %2F
) will not be treated as a path separator by the cy.route
command.
Test code to reproduce
See ikornienko/cypress-route-issue-repro.
Versions
Cypress 4.4.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Angular JS 'route' doesn't match component with %2F ...
but the / is encoded, I'm not creating nested components. Just one component - that might contain a %2F. If that doesn't work,...
Read more >Routers - Traefik Labs documentation
In Traefik Proxy, a router is in charge of connecting incoming requests to the Services that can handle them. Read the technical documentation....
Read more >Web on Servlet Stack - Spring
Designed for web use, this solution deals effectively with encoding and path parameters, and matches efficiently. AntPathMatcher — match String patterns against ...
Read more >URL Dispatch - Actix
URL dispatch provides a simple way for mapping URLs to handler code using a simple pattern matching language. If one of the patterns...
Read more >How to use character encoding classes in .NET - Microsoft Learn
A fallback strategy determines how an encoder handles invalid characters or ... When a character does not have an exact match in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone who stumbles upon it: to match a request with any query params to the route
/api/issue
(like/api/issue?param=plain
and/api/issue?param=%2Fpath%2Fto%2Fsomething
) you can pass tocy.route
this one:/api/issue\\?{*,*/**}
.Ah, I missed that in the docs, thank you for pointing out!
Hm, ok, it does make it tricky then in my case. Parameter value, opposite to the route itself, is more dynamic in most of the UIs, therefore a capability to specify “any call to this route with any query parameter value” would be great, yet I struggle now to do it with glob patterns.