browser(firefox): recompute content-length if body is overridden (#16173)

This commit is contained in:
Yury Semikhatsky 2022-08-02 13:51:05 -07:00 committed by GitHub
parent 37cc7ae6cd
commit 135971c406
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -1,2 +1,2 @@
1340 1341
Changed: lushnikov@chromium.org Tue 02 Aug 2022 07:18:19 AM PDT Changed: yurys@chromium.org Tue Aug 2 13:48:43 PDT 2022

View file

@ -874,7 +874,7 @@ function setPostData(httpChannel, postData, headers) {
return defaultValue; return defaultValue;
} }
// Clear content-length, so that upload stream resets it. // Clear content-length, so that upload stream resets it.
httpChannel.setRequestHeader('content-length', overriddenHeader('content-length', ''), false /* merge */); httpChannel.setRequestHeader('content-length', '', false /* merge */);
httpChannel.explicitSetUploadStream(synthesized, overriddenHeader('content-type', 'application/octet-stream'), -1, httpChannel.requestMethod, false); httpChannel.explicitSetUploadStream(synthesized, overriddenHeader('content-type', 'application/octet-stream'), -1, httpChannel.requestMethod, false);
} }

View file

@ -1,2 +1,2 @@
1341 1342
Changed: dgozman@gmail.com Mon Aug 1 11:35:29 PDT 2022 Changed: yurys@chromium.org Tue Aug 2 13:50:22 PDT 2022

View file

@ -874,7 +874,7 @@ function setPostData(httpChannel, postData, headers) {
return defaultValue; return defaultValue;
} }
// Clear content-length, so that upload stream resets it. // Clear content-length, so that upload stream resets it.
httpChannel.setRequestHeader('content-length', overriddenHeader('content-length', ''), false /* merge */); httpChannel.setRequestHeader('content-length', '', false /* merge */);
httpChannel.explicitSetUploadStream(synthesized, overriddenHeader('content-type', 'application/octet-stream'), -1, httpChannel.requestMethod, false); httpChannel.explicitSetUploadStream(synthesized, overriddenHeader('content-type', 'application/octet-stream'), -1, httpChannel.requestMethod, false);
} }