How to read X-RateLimit-NearLimit header in the response from Jira Cloud REST API?

I need to send many requests to fetch some issues from Jira. I occasionally get responses with 429 status-code from Jira Cloud REST API. I have read in that x-ratelimit-nearlimit header is added to the responses when less than 20% budget for calls remain. However, when I send requests with @forge/bridge’s requestJira method and try to read this header from the response, it is null. How can I read this header? Below, you can find how I try to read it.
Best regards,

const response = await requestJira("...");
const isNearLimit = response.headers["x-ratelimit-nearlimit"]; // isNearLimit is undefined for me.


According to the Fetch API spec, headers is not a normal object that you can index into. You have to get(name). Fortunately, the spec also says “The name is case-insensitive.”

I’ll admit I haven’t tried this as I don’t have any expensive requests handy. But I’m counting on the Atlassian Forge polyfill for Fetch being compliant with the spec.

1 Like

Thank you @ibuchanan . I tried this as well, however it returns always null for x-ratelimit-nearlimit header. This is the code snippet I am using:

const response = await requestJira(
                    headers: {
                        Accept: "application/json",
            if (!response.ok && response.status === 429) {
                throw new Error("Request has been rate limited")
            console.error("X rate limited header: " + response.headers.get("x-ratelimit-nearlimit"));