w3c / resource-timing

Resource Timing
https://w3c.github.io/resource-timing/
Other
119 stars 35 forks source link

Add content-type to resource-timing #341

Closed abinpaul1 closed 1 year ago

abinpaul1 commented 1 year ago

Introducing Content type. (https://github.com/w3c/resource-timing/issues/203) Fetch changes : https://github.com/whatwg/fetch/pull/1481

Explainer : https://github.com/abinpaul1/resource-timing/blob/explainer-content-type/Explainers/Content-Type.md


:boom: Error: Server Error :boom:

PR Preview failed to build. (Last tried on May 8, 2023, 11:28 AM UTC).

More _If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please [file an issue](https://github.com/tobie/pr-preview/issues/new?title=Error%20not%20surfaced%20properly&body=See%20w3c/resource-timing%23341.)._
abinpaul1 commented 1 year ago

I was trying to spec this out keeping in mind, the points mentioning not to reflect the header directly and only a set of relevant MIME types.

yoavweiss commented 1 year ago

@abinpaul1 - can we just reflect the MIME type's essensce?

abinpaul1 commented 1 year ago

Yeah, but when we reflect the essence wouldn't this be a valid essence : application/u.26363-43323-42424+zip ? Here application would be type and u.26363-43323-42424+zip is the subtype

yoavweiss commented 1 year ago

Yeah, you're right.. Maybe it'd be possible to convince the MIMESNIFF editors to modify that definition, or otherwise monkeypatch it, if ZIP is the only mimetype that can expose such UIDs

/cc @domenic @annevk

abinpaul1 commented 1 year ago

I don't think ZIP is the only one that can have such UIDs. JSON, XML MIME types also only requires subtype to end with +json, +xml. Morover, Image and audio/video MIME types does not have any restrictions on subtype (only requires the type to be image/audio/video)

domenic commented 1 year ago

Why is the full MIME type string not reflected? I couldn't find any reasoning in the explainer at https://github.com/abinpaul1/resource-timing/blob/explainer-content-type/Explainers/Content-Type.md#content-type-values.

abinpaul1 commented 1 year ago

During the WG call when this was discussed, a concern was raised regarding reflecting the exact same value returned by server. From what I could understand the concern was mainly to protect against having any unique identifier as part of content-type in server response being relflected through resource timing API. @achristensen07, it would be great if you could please confirm or expand on the concern.

yoavweiss commented 1 year ago

I believe the concerns are related to https://github.com/w3c/server-timing/issues/89 and are planned to be discussed at TPAC.

RByers commented 1 year ago

Is there something blocking this PR from landing? Context: blink intent to ship

yoavweiss commented 1 year ago

This is waiting on the Fetch PR to land.