cloudflare / cloudflare/workerd
workerd should inject a User-Agent if none is specified in the request
- Dominant language
- C++
- Stars
- 8.7k
- Forks
- 739
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 174
Description
We're failing the following subtests of `fetch/api/basic/request-headers.any.js` due to this:
- Fetch with POST with Blob body with mime type
- Fetch with PUT without body
- Fetch with POST with URLSearchParams body
- Fetch with POST with FormData body
Inserting a User-Agent is mentioned by s 4.5.15 of the fetch spec:
> If httpRequest’s [header list](https://fetch.spec.whatwg.org/#concept-request-header-list) [does not contain](https://fetch.spec.whatwg.org/#header-list-contains) `User-Agent`, then user agents should [append](https://fetch.spec.whatwg.org/#concept-header-list-append) (`User-Agent`, [default `User-Agent` value](https://fetch.spec.whatwg.org/#default-user-agent-value)) to httpRequest’s [header list](https://fetch.spec.whatwg.org/#concept-request-header-list).
-- https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
They say _should_ though. Maybe WPT is wrong to fail us for not doing it, as it doesn't say _must_?
Contributor guide
Assessment
This issue has not been assessed yet.