Skip to content

Release v2.2.2 - #984

Merged
eepMoody merged 9 commits into
mainfrom
staging
Sep 28, 2026
Merged

eepMoody merged 9 commits into
mainfrom
staging

Conversation

@open5e-release-bot

Copy link
Copy Markdown
Contributor

Automated patch release v2.2.2 from staging.

Merge with Create a merge commit. Do not squash or rebase — the finalize workflow checks for a real merge commit before marking the release as latest.

The GitHub release is a prerelease until this PR is merged. After merge, this stops being a prerelease and main is merged back into staging.

augustjohnson and others added 9 commits September 27, 2026 09:58
Part 1 of #979. The /v1/ cacheability work in part 2 is not in this change,
so this deliberately does not close the issue.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Part 2 of #979. v1 responses carried no Cache-Control, so Cloudflare treated
these extensionless paths as dynamic and nothing was cached. Without this the
part 1 redirect turns ~1.43M free 404s into ~1.43M database-backed v1 calls.

Caching the 301s as well means the edge answers them and the origin stops
seeing that traffic, which is the benefit the dropped Cloudflare redirect rule
would have provided, kept in version control instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Two bugs in the previous commit, both found by code review.

CacheControlMiddleware was last in MIDDLEWARE, so its response phase ran
before CsrfViewMiddleware and SessionMiddleware had set their cookies, making
the response.cookies and Vary: Cookie guards dead code. The browsable API was
returning Cache-Control: public alongside Set-Cookie: csrftoken, which would
have put one CSRF token in a shared cache for every viewer. Moved it first so
its response phase runs last.

It also cached the browsable API's HTML. Cloudflare ignores Vary, so an edge
copy of that HTML could be served to JSON clients for up to s-maxage. Now only
application/json responses are cached. The legacy 301s still are: their
Location does not vary by Accept.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Clears two CodeQL alerts (py/insecure-cookie, py/client-exposed-cookie). The
cookie is set on a throwaway response inside a unit test and never reaches a
client, but the guard only checks whether any cookie is present, so flagging it
the way a real session cookie would be costs nothing and avoids a suppression.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bugfix: redirect legacy unversioned /monsters/ and /spells/ to /v1/, and make /v1/ cacheable
Removed problematic 'subclass_of': ['exact'] as it was leading to n+1 query + created a django filter that returns a query set with related foreign key objected loaded.
@eepMoody
eepMoody merged commit d4aaabf into main Sep 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants