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

fix(routing): return 404 when no record is found #601

Merged
merged 2 commits into from
Apr 13, 2024

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Apr 12, 2024

Addresses ipfs/someguy#58.

Sets 404 if the router returns routing.ErrNotFound or if the list of providers is empty.

@hacdias hacdias self-assigned this Apr 12, 2024
@hacdias hacdias requested a review from a team as a code owner April 12, 2024 12:34
Copy link

codecov bot commented Apr 12, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 12 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@a26b503). Click here to learn what that means.

❗ Current head 64094bb differs from pull request most recent head dbe3e8e. Consider uploading reports for the commit dbe3e8e to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #601   +/-   ##
=======================================
  Coverage        ?   59.47%           
=======================================
  Files           ?      233           
  Lines           ?    28294           
  Branches        ?        0           
=======================================
  Hits            ?    16829           
  Misses          ?     9992           
  Partials        ?     1473           
Files Coverage Δ
routing/http/server/server.go 71.85% <57.14%> (ø)

Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Lgtm, thanks for fixing this, 404s are cachable, 500 are not, so this will save resources across all deployments.

Fine to ship, once small nit below is addressed.

routing/http/server/server.go Show resolved Hide resolved
@hacdias hacdias merged commit a02bfd5 into main Apr 13, 2024
11 of 12 checks passed
@hacdias hacdias deleted the routing-404-no-records branch April 13, 2024 08:40
wenyue pushed a commit to wenyue/boxo that referenced this pull request Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: 🎉 Done
Development

Successfully merging this pull request may close these issues.

2 participants