Skip to content

%2F not handled correctly in file backend #1184

@joachimvh

Description

@joachimvh

Environment

  • Server version: 3.0.0

Description

See discussion at nodeSolidServer/node-solid-server#1666

Copy of my comment there:

Everything seems to work correctly on the memory backend, but there are issues with the file backend.

  • PUT http://localhost:3000/pod1/c1/c2/t1%2f -> Throws an error.
  • POST http://localhost:3000/ with slug t1%2Faa -> Throws an error.
  • PUT http://localhost:3000/foo/bar -> Accessible through http://localhost:3000/foo%2fbar

ACL paths when accessing http://localhost:3000/foo/bar

http://localhost:3000/foo/bar
http://localhost:3000/foo/
http://localhost:3000/

ACL paths when accessing http://localhost:3000/foo%2fbar

http://localhost:3000/foo%2Fbar
http://localhost:3000/

Having had a quick look at the source, the URL gets converted to a relative file path in https://github.com/solid/community-server/blob/330b645236c38dcc3b0a0c1de68ebcb25eb437f1/src/storage/mapping/BaseFileIdentifierMapper.ts#L190
which calls https://github.com/solid/community-server/blob/330b645236c38dcc3b0a0c1de68ebcb25eb437f1/src/util/PathUtil.ts#L117-L119
This also converts the %2F back to / which is probably the root cause of the issue. We might just want to add an exception specifically for that character as we do want other encodings to be decoded (so the file has a space instead of %20).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions