What we ran into, and what we did about it

Notes from building and running our own software. Every technical piece is a real defect or a real decision from a codebase we run, with the code that shipped. Each one is listed with its question and the answer, so you may not need to open it.

Security

Things that were quietly wrong in our own request handling and payment flow, and what the corrected version looks like.

Rate limit before you read the body, not after
Should a rate limiter run before or after request validation? Before. A limiter placed after validation only ever throttles well-formed requests, so garbage costs an attacker nothing while genuine submissions are the only ones paying for a slot. Take the slot as the very first statement in the handler, ahead of the body read, and pair a per-IP limit with a global one — the per-IP key comes from a header a client can spoof.
7 Sep 2026
Parsing the JSON is what breaks the webhook signature
Why does my Stripe webhook signature verification always fail? Because something read and re-serialised the body before verification. The signature is computed over the raw bytes Stripe sent, and parsing to an object and back changes key order, whitespace and number formatting, so the recomputed signature cannot match. Read the body exactly once with await req.text(), verify that string, and parse only after the signature has passed.
7 Sep 2026
Your checkout return URL is an open redirect unless you pin the origin
Is it safe to build a Stripe success_url from the Origin header? No. The Origin header is set by the caller, so anyone who can reach your checkout endpoint can create a real payment page on your account whose return URL points at a site they control — with your domain in the payer's history right before it. Accept the header only when it matches your canonical origin, allow localhost for development, and fall back to the canonical origin in every other case.
7 Sep 2026
The env file your .gitignore does not protect is the one that leaks
How do I check whether an API key was ever committed to git? Run git log --all -S "<the secret>" --oneline, which searches every commit on every branch for the point where that exact string entered or left the tree. Empty output means it never reached history and deleting it from the working tree is enough. Any output at all means the key is in your history and must be rotated first — rewriting history does not retrieve the clones, forks and CI caches that already have it.
7 Sep 2026

Engineering

Defects that produce no error, pass review and ship — the ones you only find by going and looking.

The success page is not a receipt, and treating it as one loses money
Can I fulfil an order on the Stripe success page instead of a webhook? No. The redirect only tells you that a browser reached a URL: the payer can close the tab first, a delayed payment method can settle hours after checkout, and a subscription renewal never redirects at all because no browser is involved. Fulfil on the signed webhook event, keep fulfilment idempotent because events are retried, and let the success page thank people without claiming that anything was paid.
7 Sep 2026
Every page on your Next.js site may be sharing one Open Graph description
Why does every page on my Next.js site have the same og:title? Because a parent layout declared openGraph and Next.js merges that object into every route below it, while a page's own title and description do not populate openGraph at all. The two fields you set per page are therefore correct in the tab and wrong in every share preview. Give each route its own openGraph.title, description and url — building all three from one per-page record is the only way they stay in step.
7 Sep 2026
Your CSS reset outranks your components, and nothing will error
Why is my CSS class not applying even though the selector matches? Almost always specificity rather than a typo. An element reset written as .page p scores (0,1,1) and outranks a single-class component rule like .lead at (0,1,0), so the component loses every time and no tool reports it — the CSS is valid and the selector really does match. Wrap element resets in :where() to drop them to (0,0,1), which still beats a framework preflight but loses to any class you write.
7 Sep 2026

Accessibility

Interfaces that announce themselves as one thing and behave as another.

How we work

The studio's own arrangements, stated plainly enough to argue with.