Skip to content

Commit ab67b1b

Browse files
authored
Merge branch 'main' into feat/dump_interceptor
2 parents fb5af55 + 0980f9d commit ab67b1b

File tree

3,120 files changed

+7252
-20512
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,120 files changed

+7252
-20512
lines changed

.github/workflows/autobahn.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Autobahn
22
on:
33
workflow_dispatch:
44

5-
pull_request:
5+
pull_request_target:
66
paths:
77
- '.github/workflows/autobahn.yml'
88
- 'lib/web/websocket/**'
@@ -30,6 +30,7 @@ jobs:
3030
- name: Checkout Code
3131
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
3232
with:
33+
ref: "${{ github.event.pull_request.merge_commit_sha }}"
3334
persist-credentials: false
3435
clean: false
3536

@@ -52,9 +53,11 @@ jobs:
5253
- name: Report into CI
5354
id: report-ci
5455
run: npm run test:websocket:autobahn:report
56+
env:
57+
FAIL_ON_ERROR: true
5558

5659
- name: Generate Report for PR Comment
57-
if: github.event_name == 'pull_request'
60+
if: (failure() || success()) && github.event_name == 'pull_request_target'
5861
id: report-markdown
5962
run: |
6063
echo "comment<<nEOFn" >> $GITHUB_OUTPUT
@@ -64,7 +67,7 @@ jobs:
6467
REPORTER: markdown
6568

6669
- name: Comment PR
67-
if: github.event_name == 'pull_request'
70+
if: (failure() || success()) && github.event_name == 'pull_request_target'
6871
uses: thollander/actions-comment-pull-request@v2
6972
with:
7073
message: ${{ steps.report-markdown.outputs.comment }}

CONTRIBUTING.md

+14-42
Original file line numberDiff line numberDiff line change
@@ -94,51 +94,23 @@ Create a commit which includes all of the updated files in lib/llhttp.
9494

9595
`undici` runs a subset of the [`web-platform-tests`](https://github.com/web-platform-tests/wpt).
9696

97-
Here are the steps to update them.
97+
### Requirements:
98+
- [Node core utils](https://github.com/nodejs/node-core-utils) setup with credentials.
9899

99-
<details>
100-
<summary>Skip the tutorial</summary>
100+
To update every test, run the following commands. Typically you would only need to update the tests in a specific directory.
101101

102102
```bash
103-
git clone --depth 1 --single-branch --branch epochs/daily --filter=blob:none --sparse https://github.com/web-platform-tests/wpt.git test/wpt/tests
104-
cd test/wpt/tests
105-
106-
git sparse-checkout add /resources
107-
git sparse-checkout add /interfaces
108-
git sparse-checkout add /common
109-
git sparse-checkout add /fetch
110-
git sparse-checkout add /FileAPI
111-
git sparse-checkout add /xhr
112-
git sparse-checkout add /websockets
113-
git sparse-checkout add /mimesniff
114-
git sparse-checkout add /storage
115-
git sparse-checkout add /service-workers
116-
```
117-
118-
</details>
119-
120-
#### Sparse-clone the [wpt](https://github.com/web-platform-tests/wpt) repo
121-
122-
```bash
123-
git clone --depth 1 --single-branch --branch epochs/daily --filter=blob:none --sparse https://github.com/web-platform-tests/wpt.git test/wpt/tests
124-
125-
cd test/wpt/tests
126-
127-
```
128-
129-
#### Checkout the tests
130-
131-
Only run the commands for the folder(s) you want to update.
132-
133-
```bash
134-
git sparse-checkout add /fetch
135-
git sparse-checkout add /FileAPI
136-
git sparse-checkout add /xhr
137-
git sparse-checkout add /websockets
138-
git sparse-checkout add /resources
139-
git sparse-checkout add /common
140-
141-
# etc
103+
git node wpt resources
104+
git node wpt interfaces
105+
git node wpt common
106+
git node wpt fetch
107+
git node wpt FileAPI
108+
git node wpt xhr
109+
git node wpt websockets
110+
git node wpt mimesniff
111+
git node wpt storage
112+
git node wpt service-workers
113+
git node wpt eventsource
142114
```
143115

144116
#### Run the tests

lib/web/fetch/body.js

+9
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,15 @@ function bodyMixinMethods (instance) {
385385
'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
386386
)
387387
}, instance, false)
388+
},
389+
390+
bytes () {
391+
// The bytes() method steps are to return the result of running consume body
392+
// with this and the following step given a byte sequence bytes: return the
393+
// result of creating a Uint8Array from bytes in this’s relevant realm.
394+
return consumeBody(this, (bytes) => {
395+
return new Uint8Array(bytes.buffer, 0, bytes.byteLength)
396+
}, instance, true)
388397
}
389398
}
390399

0 commit comments

Comments
 (0)