Browsers and Traffic

Browsers and Traffic: CORS: Which Web Pages May Call Your API, Rate Limits and Security Headers.

Updated

  1. CORS: Which Web Pages May Call Your API (Journeyman): A browser lets a web page read answers only from its own origin unless the API allows it, and FastAPI's CORSMiddleware with an allow-list of origins lets the club's own pages in, which protects people's browsers but never stops a script or a tool.
  2. Rate Limits and Security Headers (Journeyman): A sign-in route that answers every guess lets a script try thousands of passwords, so a rate limit counts each address's tries in a window of time and answers 429 with Retry-After, slowapi puts one on a FastAPI route, and a small middleware adds security headers to every answer.