Skip to content

fix(readRawBody): check req.rawBody before req.body#604

Merged
pi0 merged 1 commit intomainfrom
fix/raw-body
Jan 3, 2024
Merged

fix(readRawBody): check req.rawBody before req.body#604
pi0 merged 1 commit intomainfrom
fix/raw-body

Conversation

@pi0
Copy link
Copy Markdown
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.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

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

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 52c0109
Status:🚫  Build failed.

View logs

@codecov
Copy link
Copy Markdown

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