-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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]: Upgrade to Playwright 1.44 Causes Incomplete multipart/form-data Request Body #30788
Comments
You have two snippets, one of them uses web platform's fetch and FormData, it should not be affected by playwright, it might be a change caused by newer browser version. As far as I understand, the second example works fine when you say |
I apologize for any confusion. I provided two code snippets because we're dealing with two different types of file upload tests. The first one generates a file and sends it directly to the server programmatically using I can confirm that if I use the same browser version in the same environment with Playwright 1.43.1, the tests pass. However, if I upgrade the Playwright version to 1.44, the tests fail due to an incomplete request body, as previously described. After some investigation, we found that the cause of the issue is that the new version of playwright is somehow incompatible with our opentelemetry tracer setup. I created a minimal reproduction environment, please find it attached. Please also find additional information in the NOTE: The provided test will also fail with Playwright version 1.43.1 because the tracer isn't set up properly, but the file will be sent to the server successfully. |
The bug was fixed in microsoft#30734. This PR adds a test and updates interception logic to not send post data when it is not modified. Fixes microsoft#30788
The bug was fixed in microsoft#30734. This PR adds a test and updates interception logic to not send post data when it is not modified. Fixes microsoft#30788
This is already fixed in @next version of playwright. |
The bug was fixed in microsoft#30734. This PR adds a test and updates interception logic to not send post data when it is not modified. Fixes microsoft#30788
@yury-s, thank you for the fix. Could you please provide the release date for the new 1.45 version? |
It will be published in the next few weeks, maybe sooner. |
@barnabas-nagy-ni @servohatred just wondering whether 1.45.0 fixed this issue for either of you. The 1.44.0 release introduced a problem for us running Playwright from a recorded HAR file (using routeFromHAR), when the HAR contains a multi-part form data POST. It seemed related to the boundaries, but I am not quite sure. I was hoping it was the same as your issue, and fixed in 1.45.0, but it was not. |
@ajssd for us it fixed the issue |
Version
1.44
Steps to reproduce
We've been using Playwright for our end-to-end tests for a while now, and our tests have been working fine up to version 1.43.1. But after we upgraded to Playwright 1.44, our file upload tests started acting up.
The main issue is when we send the file to the server, the
multipart/form-data
request body is incomplete. The WebKitFormBoundary isn't closing properly, and the file content isn't getting added to the request body. This issue is causing our tests to fail because the server is unable to parse the incomplete request body.Here's the code we're using to send the request:
I did manage to find a workaround by using the new context request post method:
But we also have other tests where we add the file using the
setInputFiles
method:This method automatically sends the file to the server, but the request body has the same issue. I couldn't find a workaround for this one. And since everything was working fine until the new version, I thought I'd file a bug.
Expected behavior
The playwright tests should generate the
multipart/form-data
request body correctly.Actual behavior
The WebKitFormBoundary isn't closing properly, and the file content isn't getting added to the
multipart/form-data
request body.Additional context
The UI is written in Angular. The backend, which processes the file, is written in Elixir.
Environment
The text was updated successfully, but these errors were encountered: