Skip to content

done#405

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

done#405
Victoriia-Melnyk wants to merge 1 commit intomate-academy:masterfrom
Victoriia-Melnyk:develop

Conversation

@Victoriia-Melnyk
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

Great job! 🎉 Your implementation meets all the core requirements: the server correctly parses the URL path and query string, handles multiple/doubled slashes, and responds with the expected JSON format. While there was a note about potential improvements in URL normalization (such as handling multiple consecutive slashes and query parameters more robustly), these do not impact the functionality or correctness for the current task requirements. Keep up the good work, and consider refining the URL parsing logic in future projects for even greater robustness!


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

Footnotes

  1. Rate AI review example

Comment on lines +8 to +9
const normalizedPath = req.url.replace('//', '/');
const normalizedURL = new URL(normalizedPath, 'http://localhost:5701');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Potential issue: The normalization step req.url.replace('//', '/') only replaces the first occurrence of a double slash and does not handle cases where there are multiple consecutive slashes or query parameters. Additionally, constructing a new URL with normalizedPath as the pathname may not correctly handle the full original URL, especially if the incoming request contains a query string. Consider using the full req.url as the second argument to new URL() to ensure correct parsing of both pathname and query parameters.

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.

2 participants