-
Notifications
You must be signed in to change notification settings - Fork 43
Implement data fetching from baseURL #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,23 @@ const ExpectedCapitals = { | |
| India: "Delhi", // <- duplicate key | ||
| }; | ||
|
|
||
| request(baseURL, (error, response, body) => { | ||
| if (error) { | ||
| console.error("error:", error); | ||
| return; | ||
| } | ||
| console.log("statusCode:", response && response.statusCode); | ||
| console.log("body:", body); | ||
| }); | ||
|
|
||
| const ExpectedCapitals = { | ||
| India: "New Delhi", | ||
| USA: "WDC", | ||
| Nepal: "Kathmandu", | ||
| China: "Beijing", | ||
| India: "Delhi", // <- duplicate key | ||
|
Comment on lines
+36
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }; | ||
|
Comment on lines
+35
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| /** | ||
| * @param {string} country | ||
| * @return {[boolean, string]} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
requestlibrary was deprecated in February 2020 and is no longer maintained. Using it exposes the application to unpatched security vulnerabilities, such as improper handling of redirects which can lead to Server-Side Request Forgery (SSRF) if the URL is compromised.Replace
requestwith a modern, maintained library likeaxiosornode-fetchto ensure continued security support and prevent exposure to known exploits.