Skip to content

Fixing regression to detect actions with an explicit extension set - #2047

Merged
jwoertink merged 2 commits into
mainfrom
issues/2046
Jul 17, 2026
Merged

Fixing regression to detect actions with an explicit extension set#2047
jwoertink merged 2 commits into
mainfrom
issues/2046

Conversation

@jwoertink

Copy link
Copy Markdown
Member

Purpose

Fixes #2046

Description

A previous PR made an update to auto-detect routes based on extensions used in the request.
If a request came in for /reports.json, it would look for an action with /reports that allowed the JSON mime-type.
If a request came in for /reports.csv, then it would find the action with /reports that allowed the CSV mime-type.

However, if you defined your action as /reports.json explicitly, it would be a 404 🤦‍♂️ This PR
keeps the new auto-detect but also fixes the regression. The downside is that if you rely on the auto-detect now,
it'll technically be 2 route lookups. In the end, correctness is higher priority than performance. We can look at
doing a refactor later that maybe fixes the original issue without breaking compatibility or something.

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

@jwoertink
jwoertink merged commit 8c0e50f into main Jul 17, 2026
10 checks passed
@jwoertink
jwoertink deleted the issues/2046 branch July 17, 2026 20:15
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.

Action paths that end in an extension that's known now breaks

1 participant