[webkit-changes] [WebKit/WebKit] 6c8007: Checking for presence of request body in Service W...

youennf noreply at github.com
Tue Jan 7 01:04:37 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6c800745251d53d6486443d63b35828504446c5d
      https://github.com/WebKit/WebKit/commit/6c800745251d53d6486443d63b35828504446c5d
  Author: Youenn Fablet <youenn at apple.com>
  Date:   2025-01-07 (Tue, 07 Jan 2025)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-with-body.https-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-with-body.https.html
    A LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-with-body-worker.js
    A LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-with-body-worker.py
    M Source/WebCore/Modules/fetch/FetchBody.cpp
    M Source/WebCore/Modules/fetch/FetchBody.h
    M Source/WebCore/Modules/fetch/FetchBodyOwner.h
    M Source/WebCore/Modules/fetch/FetchResponse.cpp

  Log Message:
  -----------
  Checking for presence of request body in Service Worker causes body to be dropped from request
rdar://141454387
https://bugs.webkit.org/show_bug.cgi?id=284184

Reviewed by Chris Dumez.

When getting request.body, we create a readable stream from the request body.
Then, when making the fetch from it, we would not send the request body since we are not handling body converted as a readable stream.
We add support to get back the body as an array buffer from the readable stream.

Covered by the added test.

* LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-with-body.https-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-with-body.https.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-with-body-worker.js: Added.
* LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/fetch-with-body-worker.py: Added.
(main):
* Source/WebCore/Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::convertReadableStreamToArrayBuffer):
* Source/WebCore/Modules/fetch/FetchBody.h:
* Source/WebCore/Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::body):
(WebCore::FetchBodyOwner::body const):
* Source/WebCore/Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::fetch):

Canonical link: https://commits.webkit.org/288514@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list