Implement compression app server with streams and zlib#203
Implement compression app server with streams and zlib#203S-Khraban wants to merge 1 commit intomate-academy:masterfrom
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job on this submission! Your server implementation is very well-structured, and you've done an excellent job with routing, error handling, and using streams with the zlib module.
I am approving this solution for educational purposes so you can move forward, but there is one small detail to correct. In src/createServer.js, the compressed file's extension doesn't quite match the requirements. Your code creates filenames like file.txt.gzip, but the task specifies the extension should be .gz for gzip and .dfl for deflate.
A good way to fix this would be to create a simple map or object that links the compression type string (e.g., 'gzip') to its required file extension (e.g., 'gz'). You can then use this map to build the correct filename for the Content-Disposition header.
This is a great learning opportunity about watching for those small but important details in specifications. Keep up the fantastic work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
|
|
||
| res.setHeader( | ||
| 'Content-Disposition', | ||
| `attachment; filename=${filename}.${compressionType}`, |
There was a problem hiding this comment.
The task description specifies the file extensions should be .gz for gzip and .dfl for deflate. Your current implementation uses the full compression type name, resulting in extensions like .gzip and .deflate. You'll need to map the compression type to the correct extension.
No description provided.