Handle windows filepaths that accidentally got submitted to the server#721
Handle windows filepaths that accidentally got submitted to the server#721
Conversation
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.
nywilken
left a comment
There was a problem hiding this comment.
@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.
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.
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! |
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