-
Notifications
You must be signed in to change notification settings - Fork 305
exclude %encoded / #1690
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
exclude %encoded / #1690
Conversation
| _encodePath (pathname) { | ||
| const pathArray = pathname.split(this._exceptSlash()) | ||
| pathArray.forEach((el, i) => { | ||
| if (i % 2 === 0) pathArray[i] = encodeURIComponent(el) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to normalize path separators to lowercase or uppercase, such that they are mapped to the same filename. (see CommunitySolidServer/CommunitySolidServer#1273)
lib/resource-mapper.js
Outdated
| } | ||
|
|
||
| // encode/decode path except slash/%encodedSlash/double%encodedSlash | ||
| _exceptSlash () { return /(\/|%2f|%2F|%252F|%252f)/g } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find about the %25. Subsequently, we found that we also need to guard against sequences of %25252525 in CommunitySolidServer/CommunitySolidServer#1273.
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
|
I feel that I've been out of this code base for so long that I can't really provide a useful review at this level of detail. But LGTM. |
|
Already merged with #1695 |
see issue #1666
excludes from %encode/%decode
_exceptSlash () { return /(\/|%2f|%2F|%252F|%252f)/g }