Microsoft Graph API Retry-After is not exposed in browser

Amiram Korach 1 Reputation point
2021-08-01T20:07:34.277+00:00

We're using Graph API from office-js addin to send messages. Sometimes the user is sending many attachments and our app is getting throttled. In the response there is a Retry-After header, sometimes for a long time like 3 minutes. The problem is that since our code run in a browser, we can't access the Retry-After header since it is not exposed. The header that should expose it only expose these headers:
ETag, Location, Preference-Applied, Content-Range, request-id, client-request-id, ReadWriteConsistencyToken, SdkVersion, WWW-Authenticate

Retry-After is missing.

Microsoft 365 and Office Development Office JavaScript API
Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Deva-MSFT 2,271 Reputation points Microsoft Employee
    2021-08-13T03:19:12.41+00:00
    0 comments No comments

  2. Amiram Korach 1 Reputation point
    2021-08-16T14:32:24.89+00:00

    Thanks @Deva-MSFT . I'm not using Graph SDK but just making http requests. I already implemented my own retry handler that relies on the Retry-After header with a fallback to exponential backoff. We are limiting the user with the upload speed already. We get many 429 errors for mailbox concurrency limit, but according to docs we should be able to make 4 in parallel, and practically even 2 calls get blocked. Using an SDK won't help because the browser hides the Retry-After header since it is not in the Access-Control-Expose-Headers as I wrote, so the SDK won't no about that either. Exponential backoff won't help since it is a very long time sometimes. We just need this header to be exposed.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.