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.

`refreshTokens` failing because Content-Type defined twice in API request

See original GitHub issue

When using refreshTokens I get the following response back from Hue after debugging:

HttpError: HTTP error status: 400; {"fault":{"faultstring":"Duplicate Header \"content-type\"","detail":{"errorcode":"protocol.http.DuplicateHeader"}}}

These are the headers that are sent:

{
  baseURL: 'https://api.meethue.com',
  headers: {
    Accept: 'application/json',
    'content-type': 'application/x-www-form-urlencoded',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  },
  responseType: 'json'
}

This is in the config variable below:

image

At some point 2 content-type headers are inserted, I’m assuming if it only uses one the API call will start working.

Anyone else getting this issue?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
peter-murraycommented, Jul 27, 2021

Thank you for the feedback, there is a change to the returned payload that I have now captured and fixed, but will hold back on releasing util next week as I have other code changes in flight that I need to complete first.

0reactions
bladeycommented, Jul 27, 2021

Thanks @peter-murray, sounds great!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 4 Interceptor retry requests after token refresh
Works with parallel requests. UPDATE: The code updated with Angular 9 / RxJS 6, error handling and fix looping when refreshToken fails
Read more >
Refresh Tokens - OAuth 2.0 Simplified
Some people like to get a new access token shortly before the current one will expire in order to save an HTTP request...
Read more >
Re: Refresh token lifetime, error AADSTS50076 - Page 2
After the refresh token failed to give us valid access tokens every 24 hours for three days, we found this highlighted checkbox. We...
Read more >
Enable OAuth Refresh Tokens in AngularJS App using ASP ...
Detailed post with live example about enabling OAuth Refresh Tokens in AngularJS application using ASP.NET Web API, Owin middle-ware and ...
Read more >
Tickets (V2 Beta) | API Documentation
If you are unaware of how to obtain an authorization token, refer to Requesting Access and Refresh tokens under the Getting Access 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