discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
5.95k stars 1.26k forks source link

`invites` endpoint not returning rate limit headers #5037

Closed searri closed 2 years ago

searri commented 2 years ago

Description

When sending many GET requests to the /invites/ endpoint (as documented here), I expect to receive a rate limit informational header (as documented here) so that I can adjust my program to prevent my IP from getting temporarily blocked by Cloudflare. This header information is not being returned.

Steps to Reproduce

Simple example in Python throws error:

import requests

r = requests.get("https://discord.com/api/v10/invites/discord-api")
r.headers["X-RateLimit-Reset"]

You can also manually inspect response headers by making the request in browser: https://discord.com/api/v10/invites/discord-api

Expected Behavior

Response headers should contain at least one item from the list in the documentation (here).

Current Behavior

In both cases listed in "Steps to Reproduce", the API response lacks information about the rate limit.

Screenshots/Videos

No response

Client and System Information

Windows 11 Browser agnostic (tested on several different browsers/agents)

Jupith commented 2 years ago

Your making unauthenticated requests, use a bot token for headers