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

raise error if attachment pathname contains invalid bytes #209

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

Esther-Goldberg
Copy link
Member

safe_path is used for input, to parse a file path from the dict. This error is occurring when doing the reverse. This change throws an EvalError if any file created by the Python code isn't able to be encoded in UTF-8.

@coveralls
Copy link

coveralls commented Apr 7, 2024

Coverage Status

coverage: 90.826% (+0.1%) from 90.704%
when pulling c11b4e8 on invalid_bytes_in_filename
into f45ae67 on main.

@Esther-Goldberg
Copy link
Member Author

This would close #205

@hedyhli hedyhli linked an issue Apr 8, 2024 that may be closed by this pull request
@MarkKoz
Copy link
Member

MarkKoz commented Apr 8, 2024

Thanks for the PR! Can you add a test for this as well?

@Esther-Goldberg
Copy link
Member Author

Sure! I'll add that once I get it done

@Esther-Goldberg
Copy link
Member Author

Is a test for the error returned by nsjail enough, or should the function that creates files from paths also have a test?

@MarkKoz
Copy link
Member

MarkKoz commented Apr 9, 2024

That test is sufficient - it's what I also had in mind. However, the test is failing in CI.

@MarkKoz MarkKoz enabled auto-merge (rebase) April 9, 2024 13:54
@MarkKoz MarkKoz disabled auto-merge April 9, 2024 13:54
@MarkKoz MarkKoz enabled auto-merge (squash) April 9, 2024 13:55
@MarkKoz MarkKoz merged commit 5b606b1 into main Apr 9, 2024
6 checks passed
@MarkKoz MarkKoz deleted the invalid_bytes_in_filename branch April 9, 2024 13:57
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.

Weird-byte filenames trigger internal server error on json encode
3 participants