Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return 404 for releases missing author, e.g. /release//File-Stat-Convert instead of a 500 #3157

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

haarg
Copy link
Member

@haarg haarg commented Aug 25, 2024

Fixes #3155

@haarg
Copy link
Member Author

haarg commented Aug 25, 2024

This is an alternative to #3156. Instead of checking and rejecting an empty author, this adds type constraints to the routing. A path that we don't want to handle will just fall out as unroutable and thus give a 404. This style should nicer to use in more places, rather than having to put explicit checks and 404 redirects all over the code.

Copy link

codecov bot commented Aug 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.07%. Comparing base (9059e9d) to head (e61bdd9).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3157      +/-   ##
==========================================
+ Coverage   72.85%   73.07%   +0.22%     
==========================================
  Files          69       69              
  Lines        2391     2392       +1     
  Branches      338      338              
==========================================
+ Hits         1742     1748       +6     
+ Misses        521      518       -3     
+ Partials      128      126       -2     
Files Coverage Δ
lib/MetaCPAN/Web/Controller/Release.pm 90.19% <100.00%> (+0.09%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Member

@ranguard ranguard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, it is what I wanted to do but didn’t know how!

@haarg haarg merged commit 7b8abe2 into master Aug 25, 2024
11 checks passed
@haarg haarg deleted the haarg/return-404-missing-author branch August 25, 2024 12:39
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.

Return a 404 for /release//Text-ETSV
2 participants