Http request getaddrinfo ENOTFOUND at GetAddrInfoReqWrap.onlookup (dns.js:92:26)
See original GitHub issueSummary
The request module fail to validate the invalid http or https URL request.
Simplest Example to Reproduce
Example: Using following request this error occures http://aaa…com the
ERROR: error: { Error: getaddrinfo ENOTFOUND te…com te…com:443 at errnoException (dns.js:50:10) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26) code: ‘ENOTFOUND’, errno: ‘ENOTFOUND’, syscall: ‘getaddrinfo’, hostname: ‘te…com’, host: ‘te…com’, port: 443 } statusCode: undefined
var request = require('request');
request('http://te...com/../', function (error, response, body) {
console.log('error:', error); // Print the error if one occurred
console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
});
Expected Behavior
The request need to validate the URL pattern properly to avoid the error
Current Behavior
Possible Solution
Context
Your Environment
software | version |
---|---|
request | 2.88.0 |
node | 8.9.3 |
npm | 5.6.0 |
Operating System | Ubuntu 16.04 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:5
Top Results From Across the Web
Node.js getaddrinfo ENOTFOUND - Stack Overflow
Here is my code (practically copied and pasted from a very similar question, except with the host changed): var http = require("http"); var...
Read more >http.get returns "getaddrinfo ENOTFOUND" error #5436 - GitHub
Hi all, I'm trying to fix following problem since five days. ... I can definitely say it's NOT a DNS or a PROXY...
Read more >Node.js Error Message “getaddrinfo ENOTFOUND localhost ...
Here's what you need to do to get that server up and running! First enter this command in the terminal. sudo nano /etc/hosts....
Read more >Getaddrinfo ENOTFOUND: Get a Premium Solution for the Error
The getaddrinfo ENOTFOUND error can be thrown due to invalid values provided to the options of the http.get() function or a missing line...
Read more >Node applications on App Service Linux and getaddrinfo ...
Sometimes when making requests to external dependencies with Node applications, you may encounter an error showing “getaddrinfo ENOTOUND”.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jchris @voodootikigod @mikeal @tobowers @simov @nylen Anyone know how to fixed this bug? or know what lead to this bug? i’m also had this bug in my server.
Any help will be appreciated!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.