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

🐛 BUG: PUT request with Expect header not properly handled #7185

Open
10io opened this issue Nov 7, 2024 · 0 comments
Open

🐛 BUG: PUT request with Expect header not properly handled #7185

10io opened this issue Nov 7, 2024 · 0 comments
Labels
bug Something that isn't working

Comments

@10io
Copy link

10io commented Nov 7, 2024

Which Cloudflare product(s) does this pertain to?

Workers Runtime, Wrangler

What version(s) of the tool(s) are you using?

3.85.0 [Wrangler]

What version of Node are you using?

10.5.0[npm], v20.12.2[Node.js]

What operating system and version are you using?

Mac Sonoma 14.7.1

Describe the Bug

Context

We are using a cloudflare worker as a proxy in front of a backend.

That backend can receive PUT requests with the Expect header set.

This is used, for example, by mvn commands when uploading files. See this section from the Maven documentation.

Observed behavior

The backend will correctly return the 100 Continue response code in order to receive the request body.

It seems that the worker "interprets" the 100 Continue response code as "the response has been sent". Thus, trying to read the request body after that ends up in an error (the backend will hit an unexpected EOF).

Expected behavior

The 100 Continue response code should not be considered as "the response has been sent" as the client will follow up with the request body.

Steps to reproduce

Follow the steps that are described in: https://github.com/10io/wrangler-expect-header.

Please provide a link to a minimal reproduction

https://github.com/10io/wrangler-expect-header

Please provide any relevant error logs

[wrangler:inf] PUT /dummy.txt 503 Service Unavailable (2ms)
✘ [ERROR] Uncaught (async) TypeError: Can't read from request stream after responding with an exception.
@10io 10io added the bug Something that isn't working label Nov 7, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Nov 7, 2024
@penalosa penalosa moved this from Untriaged to Backlog in workers-sdk Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant