Skip to content

Conversation

@bourgeoa
Copy link
Member

see issue #1666
excludes from %encode/%decode _exceptSlash () { return /(\/|%2f|%2F|%252F|%252f)/g }

_encodePath (pathname) {
const pathArray = pathname.split(this._exceptSlash())
pathArray.forEach((el, i) => {
if (i % 2 === 0) pathArray[i] = encodeURIComponent(el)
Copy link
Contributor

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)

}

// encode/decode path except slash/%encodedSlash/double%encodedSlash
_exceptSlash () { return /(\/|%2f|%2F|%252F|%252f)/g }
Copy link
Contributor

@RubenVerborgh RubenVerborgh Apr 22, 2022

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.

bourgeoa and others added 2 commits April 26, 2022 17:41
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
@bourgeoa bourgeoa linked an issue Apr 26, 2022 that may be closed by this pull request
@bourgeoa bourgeoa self-assigned this Apr 26, 2022
@kjetilk
Copy link
Member

kjetilk commented May 3, 2022

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.

@bourgeoa
Copy link
Member Author

Already merged with #1695

@bourgeoa bourgeoa closed this Sep 14, 2022
@bourgeoa bourgeoa mentioned this pull request Mar 17, 2023
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.

Mis handling of percent encoded paths

4 participants