Auto merge of #29627 - CYBAI:respect-headers-ct, r=mukilan

Respect MIME type from headers instead of caching it

Based on the spec,

> A [Request](https://fetch.spec.whatwg.org/#request) object’s [MIME type](https://fetch.spec.whatwg.org/#concept-body-mime-type) is to return the result of [extracting a MIME type](https://fetch.spec.whatwg.org/#concept-header-extract-mime-type) from its [request](https://fetch.spec.whatwg.org/#concept-request-request)’s [header list](https://fetch.spec.whatwg.org/#concept-request-header-list).

request and response should always return the MIME type from their header list. As we're currently caching the mime type directly, this PR will help to remove the caching field and always retrieve from headers instead.

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)
- [x] There are tests for these changes
This commit is contained in:
bors-servo 2023-04-14 07:51:58 +02:00 committed by GitHub
commit 4251159513
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 85 additions and 148 deletions

View file

@ -1,39 +0,0 @@
[mime-type.any.html]
[Request: overriding explicit Content-Type]
expected: FAIL
[Response: setting missing Content-Type]
expected: FAIL
[Response: overriding explicit Content-Type]
expected: FAIL
[Request: setting missing Content-Type]
expected: FAIL
[Response: removing implicit Content-Type]
expected: FAIL
[Request: removing implicit Content-Type]
expected: FAIL
[mime-type.any.worker.html]
[Request: overriding explicit Content-Type]
expected: FAIL
[Response: setting missing Content-Type]
expected: FAIL
[Response: overriding explicit Content-Type]
expected: FAIL
[Request: setting missing Content-Type]
expected: FAIL
[Response: removing implicit Content-Type]
expected: FAIL
[Request: removing implicit Content-Type]
expected: FAIL