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(server): set cache-control header only after processing image #200

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

ucw
Copy link
Contributor

@ucw ucw commented Dec 27, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Currently, the Cache-Control header is set before image processing takes place. This can lead to the caching of a 500 error in Cloudflare if an exception occurs during image processing. The changes in this pull request move the setting of the Cache-Control header after the image processing to prevent the caching of 500 errors in such scenarios.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pi0 pi0 changed the title fix: avoiding 500 Error Caching fix(server): set cache-control header only after processing image Dec 27, 2023
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (fc8a0de) 54.10% compared to head (873ecfa) 54.10%.
Report is 4 commits behind head on main.

Files Patch % Lines
src/server.ts 0.00% 9 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #200   +/-   ##
=======================================
  Coverage   54.10%   54.10%           
=======================================
  Files          11       11           
  Lines        1083     1083           
  Branches       45       45           
=======================================
  Hits          586      586           
  Misses        497      497           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@pi0 pi0 merged commit c384362 into unjs:main Jan 11, 2024
3 of 4 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.

2 participants