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

Handle windows filepaths that accidentally got submitted to the server #721

Merged
merged 1 commit into from
Aug 28, 2018

Conversation

kytrinyx
Copy link
Member

@kytrinyx kytrinyx commented Aug 26, 2018

Some of the older CLIs did not submit a normalized path for the file, but rather submitted the
filepath. This means that we sometimes had forward slashes and sometimes had backslashes.

The CLI now always submits the normalized path with forward slashes.

This ensures that when we receive files submitted with a buggy client we rewrite the paths
correctly.

Closes exercism/exercism#4260
Closes exercism/exercism#4101
Closes exercism/exercism#4072

Some of the older CLIs did not submit a normalized path for the file, but rather submitted the
filepath. This means that we sometimes had forward slashes and sometimes had backslashes.

The CLI now always submits the normalized path with forward slashes.

This ensures that when we receive files submitted with a buggy client we rewrite the paths
correctly.
@kytrinyx kytrinyx requested a review from nywilken August 26, 2018 19:23
@kytrinyx kytrinyx changed the title Fix windows filepaths that accidentally got submitted to the server Handle windows filepaths that accidentally got submitted to the server Aug 26, 2018
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kytrinyx this is good to go. It took me some time to review because I wanted to test on Windows. Just to be clear this fix handles the downloading, but to actually fix on the backend the user would have to submit the solution, correct?

At some point I got the double path error on Windows C:\workspace-path\C:\workspace-path\track\slug but I can't seem to reproduce so I am just mentioning in case you have a better way to test this. I guess this would only be a problem if we stored the full path as part of the filename.

@kytrinyx
Copy link
Member Author

to actually fix on the backend the user would have to submit the solution, correct?

Yeah, though the latest release of the CLI does submit the correct one, I believe. I also have on my list to clean up old data on the server.

At some point I got the double path error on Windows

Damn, I wish I knew what situation we get that in, I've not yet got a good reproduction case to work from to fix that one.

Thanks for the review!

@kytrinyx kytrinyx merged commit e6277a7 into master Aug 28, 2018
@kytrinyx kytrinyx deleted the backslash-paths branch August 28, 2018 01:15
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