Skip to content

Conversation

@ankon
Copy link
Contributor

@ankon ankon commented Jul 4, 2016

No description provided.

log.debug("Found '{}' cookie value [{}]", name, value);
// Validate that the cookie is used at the correct place.
String path = StringUtils.clean(getPath());
if (path != null && !request.getRequestURI().startsWith(path)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just check if getPath() != calcualtePath(...) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing something, but if getPath() returns a non-null/non-empty string, then calculatePath(request) would return that value, which would trivially be equal?

@ankon
Copy link
Contributor Author

ankon commented Jul 7, 2016

While looking at the question about #calculatePath(), I checked the rules for path matching for browsers, and found an edge case: the logic would accept a prefix that is not a complete path, for example it would accept requests from '/foobar/something.jsp' as matching for the cookie with a path of '/foo'.

@bdemers
Copy link
Member

bdemers commented Jul 7, 2016

+1 🍪 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants