ducaale / xh

Friendly and fast tool for sending HTTP requests
MIT License
4.96k stars 90 forks source link

support zstd formatted responses #364

Closed zuisong closed 1 month ago

zuisong commented 2 months ago

Chrome versions after 123 already support zstd. (can i use zstd) Firefox will support zstd https://github.com/mozilla/standards-positions/issues/775#issuecomment-2049605786

Maybe we should also support zstd formatted responses.

image

blyxxyz commented 2 months ago

I'm unsure about this. It'd add another 150KB to the binary (pushing us over 8MB). And I don't know how much upside there is. In which cases would somebody really need it or be helped by it? (In download mode we don't even enable compression.)

I'm also worried about whether this can dynamically link to the system's libzstd, since that's how (some) distros prefer to work. openssl-sys has some cargo features related to this but I don't see that in zstd-sys. I don't really know the details about how this is normally handled and what -sys packages tend to do but it might be a headache (or just busywork) for distro maintainers.

(The ruzstd crate could potentially help with both of these but I don't know how mature it is.)

The code does look good.