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.
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 aswebaudio-1.0
in the W3C API. This updates the shortname accordingly.