Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
This is a really solid implementation, and you've correctly handled the core logic with streams and error handling. I am requesting one change related to the compressed file's name. Currently, the filename extension for compressed files doesn't quite match the requirements. For example, a file compressed with gzip is named filename.gzip instead of filename.gz. The same applies to deflate, which should produce a .dfl extension. To fix this, consider creating a mapping between the compressionType from the form (gzip, deflate) and the required file extension (gz, dfl). You can then use this map to construct the correct filename in the Content-Disposition header. Once that's adjusted, this will be ready for approval!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
|
|
||
| res.setHeader( | ||
| 'Content-Disposition', | ||
| `attachment; filename=${fileName}.${compresionType}`, |
There was a problem hiding this comment.
The filename extension for the compressed file doesn't fully meet the requirements. The task specifies that gzip compression should result in a .gz extension and deflate should result in a .dfl extension. This implementation uses the compressionType value directly, which produces .gzip and .deflate. Consider mapping the compressionType value to the correct file extension.
Anton-Kuchmasov
left a comment
There was a problem hiding this comment.
Well done!
Last test fail (createServer › Server › POST to the "/compress" endpoint › ivalid form data scenarios › should respond with 400 status code if no compression type is provided) can't be reproduced (I've tried to do this in Postman),
by the way, this student' solution is working well
No description provided.