Skip to content

bag-with-compresionType#221

Open
Vlshedevr wants to merge 1 commit intomate-academy:masterfrom
Vlshedevr:develop
Open

bag-with-compresionType#221
Vlshedevr wants to merge 1 commit intomate-academy:masterfrom
Vlshedevr:develop

Conversation

@Vlshedevr
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example


res.setHeader(
'Content-Disposition',
`attachment; filename=${fileName}.${compresionType}`,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

@Anton-Kuchmasov Anton-Kuchmasov left a comment

Choose a reason for hiding this comment

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

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

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.

3 participants