Skip to content

solution#481

Open
Artemida1609 wants to merge 2 commits into
mate-academy:masterfrom
Artemida1609:develop
Open

solution#481
Artemida1609 wants to merge 2 commits into
mate-academy:masterfrom
Artemida1609:develop

Conversation

@Artemida1609
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings May 10, 2026 15:01
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

Your implementation correctly parses URL query parameters and returns the parts array, but there's a critical bug that needs fixing: doubled slashes in URL paths are not being filtered. When a path like //hello/world is requested, split('/') produces ['', 'hello', 'world'] instead of the expected ['hello', 'world']. You need to add .filter(part => part !== '') after the split to remove empty string entries. Also, please remove the console.log(parts) debug statement before finalizing. Once this filtering is added, your code will pass all requirements.


✨ 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

Comment thread src/createServer.js Outdated
// Return instance of http.Server class
const server = http.createServer((req, res) => {
const normalizedURL = new URL(req.url, 'http://localhost:5700');
const parts = normalizedURL.pathname.split('/').slice(1);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This line needs to filter out empty strings from doubled slashes. Currently /hello works but //hello produces ['', 'hello'] instead of ['hello']. Add .filter(part => part !== '') to remove empty segments.

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

Your solution correctly implements all task requirements. The doubled slashes are properly filtered using the .filter() method, query parameters are correctly parsed into an object, and the server returns the expected JSON structure with both parts and query properties. The implementation passes all checklist items. There's one minor cleanup item: a debug console.log(parts) statement on line X that should be removed before production, but this is a cosmetic issue that doesn't affect functionality.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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