discountCode.lookup() returns 401
See original GitHub issueIt looks like discountCode lookup method returns a redirection to the actual resource. Since the url we get forwarded to is not authenticated, we get a 401, which make sense.
This crash is quite easy to reproduce, simple look up any existing code. If you look for a non existing code, the request will return the following response without any redirection :
{
"errors": "Not Found"
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top Results From Across the Web
401 Error: 5 Ways to Troubleshoot and Fix It - Hostinger
The 401 Unauthorized error is triggered by unauthenticated requests made to a WordPress web server. Learn how to identify and fix the issue....
Read more >Solved: Discount code returns 401 unauthorized access after ...
The lookup endpoint returns a 303 with the location of the discount code. The HTTP client follows this and username:password is lost.
Read more >How to Fix a 401 Unauthorized Error - Lifewire
A 401 Unauthorized error means the page you were trying to see needs a valid user ID/password before you can view it.
Read more >How to Quickly Fix the 401 Unauthorized Error (5 Methods)
The 401 (Unauthorized) status code indicates that the request has not been applied because it lacks valid authentication credentials for the ...
Read more >Why am I getting a "401 Unauthorized" error in Maven?
According to this sonatype support page: "If you are receiving a 401 it is because maven is sending the wrong login credentials, or...
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 Free
Top 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

Yeah, that’s what exactly I mentioned in my previous comment. But Got should update the options with the credentials and for some reason it doesn’t. Will fix this ASAP.
@szmarczak here is a test to reproduce the issue.
It seems this stopped working with
got@10.