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(readRawBody): check req.rawBody before req.body #604

Merged
merged 1 commit into from
Jan 3, 2024
Merged

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jan 3, 2024

πŸ”— 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

With readRawBody utility, we check req.body that can be provided from direct-fetch/unenv. (sadly) this conflicts with some runtimes (firebase) as I discovered which provides req.body as "parsed body".

Later we shall avoid depending on both and instead translate rawBody directly from higher-oder layers (user project or nitro preset entry for example) but this is a quick workaround for the situation.

πŸ“ Checklist

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

Copy link

cloudflare-workers-and-pages bot commented Jan 3, 2024

Deploying with Β Cloudflare Pages Β Cloudflare Pages

Latest commit: 52c0109
Status:🚫  Build failed.

View logs

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Comparison is base (53703dc) 74.36% compared to head (52c0109) 74.65%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #604      +/-   ##
==========================================
+ Coverage   74.36%   74.65%   +0.28%     
==========================================
  Files          47       47              
  Lines        4245     4246       +1     
  Branches      565      574       +9     
==========================================
+ Hits         3157     3170      +13     
+ Misses       1073     1061      -12     
  Partials       15       15              

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

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.

1 participant