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.

Authorization header

See original GitHub issue

I can not find in the documentation how to set headers for the request.

How can I bypass this check in supertest?

router.use (req, res, next) ->
  return next() if req.headers.authorization is 'somekey'
  res.send 401

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
schmtycommented, Jun 26, 2015

I am unable to set a custom header I have token middleware that will verify a jwt token in the ‘x-access-token’ header. but doing something like this

request(app)
  .put('/user/' + a_user_id)
  .set('x-access-token', myToken)
  .end(callback);

The ‘x-access-token’ header is never set

0reactions
orimdominiccommented, Oct 18, 2020

Is there any plan to prevent the automatic lowercasing?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authorization - HTTP - MDN Web Docs - Mozilla
The HTTP Authorization request header can be used to provide credentials that authenticate a user agent with a server, allowing access to a ......
Read more >
Basic access authentication - Wikipedia
In basic HTTP authentication, a request contains a header field in the form of Authorization: Basic <credentials> , where credentials is the Base64...
Read more >
Http authorization header entity definition - Microsoft Learn
An authorization header used in HTTP request. Pattern. Various authentication header formats for example: authorization: basic ********
Read more >
HTTP headers | Authorization - GeeksforGeeks
The HTTP headers Authorization header is a request type header that used to contains the credentials information to authenticate a user ...
Read more >
Bearer Authentication - Swagger
The client must send this token in the Authorization header when making requests to protected resources: Authorization: Bearer <token>.
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