w3c / browser-specs

A machine-readable list of Web specifications
Other
226 stars 46 forks source link

Fix detection of shortname change, update shortname of webaudio #1559

Closed tidoust closed 1 week ago

tidoust commented 1 week ago

For some reason, the code assumed that the fetch API would not follow permanent redirects.

The fetch API follows redirects by default and that's a good thing as requests on the /specifications/[shortname]/versions/latest API endpoint typically return a 302 to the actual version that is the current latest version.

This update rather relies on the redirected flag to detect redirects and checks the final URL to see whether the W3C API knows the spec under a different shortname. It throws when that happens, as before.

Build would typically fail on webaudio since it is now known as webaudio-1.0 in the W3C API. This updates the shortname accordingly.