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(cache): set content length for put artifact #9183

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

chris-olszewski
Copy link
Member

Description

Fixes #9177

In #8081 we changed from setting the body of our PUT requests from a vec of bytes to a stream of bytes.

This results in the underlying hyper request having a body with Kind::Wrapped instead of Kind::Once. This results in the body no longer having an exact length. With the body no longer having an exact length, hyper would no longer set Content-Length for us source.

This PR explicitly sets the content length header. It would be nice if we could set the length on the body itself, but hyper doesn't allow for this flexibility. (We cannot simply implement a size hint on UploadProgress, but the size hint should return the size of the stream, not the number of bytes in the stream)

Testing Instructions

Added an assertion on the mock PUT /artifacts endpoint to make sure that Content-Length gets set.

Copy link

vercel bot commented Sep 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2024 0:34am
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 0:34am
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 0:34am
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 0:34am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 0:34am
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 0:34am
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 0:34am
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 0:34am
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 0:34am

@chris-olszewski chris-olszewski marked this pull request as ready for review September 25, 2024 20:19
@chris-olszewski chris-olszewski requested a review from a team as a code owner September 25, 2024 20:19
@chris-olszewski chris-olszewski merged commit dfe3ca2 into main Oct 2, 2024
40 checks passed
@chris-olszewski chris-olszewski deleted the olszewski/fix_content_len branch October 2, 2024 16:45
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.

Self Hosted Remote Cache no longer works with AWS S3 presigned URLs starting in 1.13.4
2 participants