staticFilesGetServerEndpoint gzip support

withUseGzippedIfAvailable flag support do not seem to be implemented for “Files”
AFAIU resolveGzipSibling is not used.

@oNouguier the link you provided points to a commit from older Tapir version. Gzip siblings are resolved in 1.3.0 tapir/Files.scala at master · softwaremill/tapir · GitHub

However, if you’re still experiencing problems with this feature in 1.3.0, you may be running into issue [BUG] Fail to get static files with `useGzippedIfAvailable` options · Issue #2869 · softwaremill/tapir · GitHub
Because of this issue pre-gzipped file will be returned correctly only when the Accept-Encoding header is equal to gzip, so it fails for header values like gzip, deflate.
A fix for that has been merged recently, and it will be released soon.

@oNouguier tapir 1.4.0 has been released, with fixed support for the mentioned issue.

I saw that (I was off today :D), now the gzip file is used, but the file is downloaded by the browser rather than displayed.
But is the gz file is missing, the unzipped content is displayed.

Is it intended ?
(It is not a issue for me as it is the expected behaviour)

Thanks for the update.

I think it’s the default browser behavior to download, if content type is gzip.

Isn’t this determined by the Content-Disposition header, and its value: inline or attachment? (+ filename)

1 Like