Skip to content
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

Fix: size display for dirs with spaces in the name #1483

Closed
wants to merge 1 commit into from

Conversation

Prajjwal
Copy link

@Prajjwal Prajjwal commented Mar 9, 2025

DirSize requests for dirs with a space in the name contain a urlencoded name (eg. { DirSize: "/hello%20world" }), leading to a 400 Bad Request. The frontend then injects the error response body directly into the page.

  1. Handle failures by returning a default string if this request fails.
  2. Decode the payload before the request is issued.

Before:

image

After, upon request failure:

image

After, with uridecoded payloads:

image

Notes

  • Decoding this on the server along with a test is probably a better way of doing this.

DirSize requests for dirs with a space in the name contain a urlencoded
name (eg. { DirSize: "/hello%20world" }), leading to a 400 Bad Request.
The frontend then injects the error response body directly into the
page.

1. Handle failures by returning a default string if this request fails.
2. Decode the payload before the request is issued.
@svenstaro
Copy link
Owner

Hey, thanks for this. I went ahead and fixed this in the backend so now we can either take percent-encoded paths or plain paths. I used your line of code for JS-side error handling.

@svenstaro svenstaro closed this Mar 9, 2025
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