Unsupported Content-Disposition header value when fetching godot templates

I’ve been trying to add the godot export templates as a lazy dependency to make my game project easy to get started on fresh environments:

zig fetch --save=godot_export_templates https://github.com/godotengine/godot/releases/download/4.4.1-stable/Godot_v4.4.1-stable_export_templates.tpz

However, this is failing with the error in the title

Some obvious points before people jump to pointing these out:

  • Yes, the file extension is .tpz, but this is just how godot recognizes that this holds export templates. It’s actually a zip archive
  • Yes, even the mime-type is an archive:
  • Yes, even the http headers report an octet-stream content-type, which is how other archives are reported:

So is there a work-around, or does zig hard-check the file extension and bottoms out due to not recognizing it?

There currently isn’t a workaround. This is the relevant function: https://codeberg.org/ziglang/zig/src/commit/d5181a9c9bacc1c11930bc3581f9a44c49c27e01/lib/compiler/Maker/Fetch.zig#L1140

Maybe it should be patched with .tpz but I’m not finding things much about the file extension online.

My PR would provide a workaround: https://codeberg.org/ziglang/zig/pulls/36226
But it’s not passing CI yet!

EDIT: Actually here’s the entire file determining code: https://codeberg.org/ziglang/zig/src/commit/d5181a9c9bacc1c11930bc3581f9a44c49c27e01/lib/compiler/Maker/Fetch.zig#L1340-L1397

It’s probably something like “TemPlate Zip”. It’s implemented with zipio in godot