Closed Maff- closed 7 years ago
You seem to be right. The problem is that '/' becomes '//'. The trailing slash is necessary because of how the comparison works, otherwise /cookies and /cookiesAndCakes would be a match as well. Adding rtrim sounds like a solution to me, but we need to add some test cases as well.
Also, I am not 100% sure that only 1.4 is affected and this is something that I would backport as a fix as well to all affected minor versions.
Hi Márk, thank you for your response. I've created a PR with the proposed fix.
Actual Behavior
When having a Cookie with the path set to the domain root (e.g.
/
), and checking to see if another path matches (i.e./cookies
) it will always fail. (Except when checking an exact match,/
).Expected Behavior
I expect path
/cookies
to match a Cookie with path/
.Steps to Reproduce
Possible Solutions
A solution shouldn't be to hard to find. My guess is that adding a trailing slash isn't completely correct, but reading the linked rfc section doesn't make things easier. 😕
current code. not a solution!: