sol#236
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The implementation has a critical typo that prevents the form from working correctly. In src/index.html on line 13, the select field has name="comprassionType" (double 's'), but the server in src/createServer.js expects fields.compressionType (single 's'). This mismatch means fields.compressionType will always be undefined on the server side, causing the validation to fail with a 400 error for every form submission—even when all other values are correct.
The fix is straightforward: Change the name attribute in the select element from comprassionType to compressionType to match what the server expects.
Note: The server implementation in
createServer.jsis solid and correctly implements all requirements (Streams, zlib module, proper status codes, error handling). Only the HTML form's attribute name needs correction.
✨ 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
| // Return instance of http.Server class | ||
| return http.createServer((req, res) => { | ||
| if (req.url === '/') { | ||
| res.statusCode = 200; |
There was a problem hiding this comment.
Typo: comprassionType should be compressionType (with double 's'). The server code on line 45 expects fields.compressionType, so this mismatch will cause the form validation to always fail.
| <input type="file" name="file"> | ||
|
|
||
| <!-- 2. випадаючий список --> | ||
| <select name="comprassionType"> |
There was a problem hiding this comment.
Typo in the name attribute: 'comprassionType' should be 'compressionType' to match what the server expects in fields.compressionType
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation is approved and meets all task requirements. The critical typo from the previous review has been successfully fixed - the select field in src/index.html now correctly uses name="compressionType" which matches what the server expects. Both the HTML form and server are fully functional: the form provides proper file selection, compression type options (gzip, deflate, br), and correct submission attributes; the server correctly handles validation, uses Streams with zlib, and returns appropriate status codes for all scenarios (200 for success, 400 for invalid requests, 404 for non-existent endpoints). All checklist items pass and your solution is ready for testing.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.