Can't Find csp.json

Gang,

I’m trying to update browser compatibility for Content Security Policy. The Compat() macro call is to http.headers.csp. Yet when I looked in I didn’t find a csp.json. I did find a content-security-policy.json.

Am I misunderstanding how links to compatibility data work, or is there a redirect somewhere?

Joe

Hi Joe

I think the name of the JSON files doesn’t matter, or even how the data is split up among files or how it is organized. There’s some code that walks through all the JSON files building it into a single tree. You can then fetch a piece of the tree using a string of dot-separated identifiers.

So what matters is the identifiers inside the files, and that’s csp: https://github.com/mdn/browser-compat-data/blob/master/http/headers/content-security-policy.json#L4.

Will

1 Like

Sounds to me like the macro is writt

Right; the "http.headers.csp" isn’t a pathname, it’s built based on the labels in the JSON files themselves.

Sheppy

Is this documented somewhere obvious? I suspected that was the case, but since for every instance I had seen until now there was a 1:1 correspondence between object name and path, I wanted to be sure.

It’s documented in the schema readme in the repo. See especially the “File and folder breakdown” section.