[server] x-accel: encode all paths to URIs #2120
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
updates util function encodeUriPath to use node:url with a file:// path prefix, and updates all instances x-accel redirection to use this helper util instead of sending unencoded paths into the header.
Using a local dev container with an external nginx reverse proxy for x-accel: I tested covers, audio files, and ebooks which all played correctly, even with unicode chars. I was unable to get download working, but I think that was just because of my test setup. I don't see any reason it should function differently in a proper setup...
fixes errors such as:
[the error in this specific file is the colon which is
modifier letter triangular colon (U+02D0)
]this also changes the log to output the full encoded x-accel path (which means it now includes the prefix):