-
-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Would it be possible to return the rate limit headers for every API call? X-RateLimit-Limit, X-RateLimit-Remaining, & X-RateLimit-Reset.
Currently, there's no method of checking the current rate limit values until the limit is hit.
Once the limit is reached the values are returned in the error:
masto.js/src/http/http-native-impl.ts
Lines 79 to 87 in c0c8ee0
| throw createError({ | |
| statusCode: error.status, | |
| message: data?.error, | |
| details: data?.errorDescription, | |
| description: data?.details, | |
| limit: error.headers.get('X-RateLimit-Limit'), | |
| remaining: error.headers.get('X-RateLimit-Remaining'), | |
| reset: error.headers.get('X-RateLimit-Reset'), | |
| } as CreateErrorParams); |
Alternatively, is there a way to get access to the HTTP response object, and get the headers directly?
fadookie, cheeaun, janl and AgathaSorceress
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed