Dear All,
I’m trying to get the "Fitbit-Rate-Limit-Remaining" and "Fitbit-Rate-Limit-Limit" headers, from the response of the Angular 2 REST. Unfortunatelly I can see only these headers: "Content-Type", "Cache-Control" and "Content-Language".
For testing purpose, I created a custom header on a test server. And was been received by the Angular 2 REST, but only if the header "Access-Control-Expose-Headers" was set to the custom header.
Example: "Access-Control-Expose-Headers: Fitbit-Rate-Limit-Limit, Fitbit-Rate-Limit-Remaining, Fitbit-Rate-Limit-Reset"
Is the "Access-Control-Expose-Headers" header set on your server API?
Thank you for the help!
Best Answer
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
It seems that the browser receive all the headers, but it won't expose all the headers to JavaScript. The extra headers to expose are to be declared on the "Access-Control-Expose-Headers" header on server side. Information: https://www.w3.org/TR/cors/#access-control-expose-headers-response-header
I tested this behaviour on a test server. Please can a moderator ask the developer team to check? Thanks a lot! 🙂
Best AnswerI found what was the issue: if the callback URL isn't SSL, on JavaScript the headers aren't received. 🙂
Best Answer