BCD and Want-Digest/Digest HTTP headers

I’m writing docs for the Digest and Want-Digest HTTP headers:

Briefly:

  • a client includes Want-Digest in a request to ask the server to provide a digest of the requested resource.

  • server includes Digest in a response to convey a digest of the requested resource to the client.

One of the things I am supposed to do here is add BCD. But:

  1. I’m not sure how to find out which browsers support it, because it depends on server support as well. So I can add Want-Digest to a request using the devtools (and I see it in the request), but I still won’t get a digest back unless the server is configured to support it. I wondered if httpbin.org might help here but it doesn’t seem to.

  2. The standard doesn’t say anything about when a browser should includeWant-Digest, or what the browser should do with a Digest response. I guess this is a matter for the application? So I’m not very clear on what “browser support” really means in cases like this.

1 Like

I’d suggest asking the Firefox dev team’s networking guys how they test stuff like this. They must know of a good way to do this.

Yeah, I’m not sure about that one. I’d ping the devs about this as well and see what they think.

Sheppy

1 Like

When Jean-Yves and I originally created the HTTP docs three years ago, we were quite unsure how to deal with this. I was trying to not add compat tables to certain header pages and instead have a sentence or two explaining that you can set the header but it ultimately depends on the server or the server config if the feature works. However, it seemed that people quite liked having all the headers in BCD, so PRs like this one happened: https://github.com/mdn/browser-compat-data/pull/2260. Obviously the compat table at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded#Browser_compatibility is rather useless and I’m thinking I shouldn’t have merged this.

So, I think our options are (at least):

  1. Add servers to the mdn-browser-compat-data project and then have a compat table with server information. I don’t think this would be a maintainable thing to do for us. We don’t have the bandwidth.

  2. Add null value tables, so the header is recorded as “existing” in BCD and in the rendering you see question marks. See the Forwarded case. I don’t think this is ideal either.

  3. Add true value tables, so it marked as supported throughout, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host as a case. This looks okayish to me. Still doesn’t make all that much sense but isn’t wrong either.

  4. Don’t have tables for these headers and instead write some text in the browser compat section explaining that it depends on servers. If known, list what common servers do or since when they support it.

I’m voting for 3 or 4 but I’m interested what others think on the matter.

Florian

2 Likes

Thanks Florian, that is helpful. It’s good to know I’m not the first to grapple with this.

Add servers to the mdn-browser-compat-data project

We’d also have to rename it mdn-browser-and-server-compat-data. No, I agree that 3 or 4 are the better options. I’m also not sure which is best between those two.

Of course there are headers, like CSP, where “browser support” does mean something.

2 Likes