question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

basic auth not working in Node 8.x

See original GitHub issue

This code works in Node 7.x:

const req = require("http").request({
    auth: "user:pass",
    hostname: "temp",
    method: "GET",
    path: "/auth/index.html"
});

req.once("response", function(response) {
    console.log(response)
    response.on("data", () => {});
    response.once("end", () => done());
})
.on("error", error => console.log(error));

req.end();

In 8.x, it logs this:

{ Error: Nock: No match for request {
  "method": "GET",
  "url": "http://temp/auth/index.html"
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ianwsperbercommented, Jul 17, 2017

Should be fixed in 9.0.14. Please reopen if issue persists.

0reactions
lock[bot]commented, Sep 13, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Basic HTTP authentication with Node and Express 4
Version 4 (I'm using 4.2) removed the basicAuth middleware, though, so I'm a little stuck. I have the following code, but it doesn't...
Read more >
NodeJS - Basic Authentication Tutorial with Example API
Run the Node Basic Authentication API Locally​​ Install Node. js and npm from https://nodejs.org. Install all required npm packages by running ...
Read more >
Basic Authentication in Node.js using HTTP Header
Open any browser with http://localhost:3000 location in a private window(in order to avoid a saved password and username). A pop will occur near ......
Read more >
RFC 7617: The 'Basic' HTTP Authentication Scheme
This document updates the definition, and also addresses internationalization issues by introducing the 'charset' authentication parameter (Section 2.1).
Read more >
How to set Basic Authentication in Postman for REST call
Here the modem might interpret it as a reset command and will reset itself. In order to avoid such problems, it is beneficial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found