Open nkast opened 1 year ago
I updated the http request/response as captured by Firefox. I also removed the .gz files from the Web.zip of my game and re-uploaded.
I requested both 'blazor.boot.json' and 'blazor.boot.json.br': both files return as gzip compressed,
content-encoding: gzip
content-length: 3384
There is a difference in the 'x-goog-stored-content' headers blazor.boot.json:
x-goog-stored-content-encoding : identity
x-goog-stored-content-length : 7054
blazor.boot.json.br:
x-goog-stored-content-encoding : br
x-goog-stored-content-length : 3132
The file I finally get from the fetch() method is the plaintext of 'blazor.boot.json' ! It is clear that the server, 1) decompress the 'blazor.boot.json.br' file on the fly. (???) 2) Recompress it as gzip on the fly.
What I would expect is to receive the compressed brotli content of 'blazor.boot.json.br' in the response body. Regardless of whether it goes through gz compression or not. There has to be a recent change on the server configuration because everything was working fine a while ago.
Thank you for the detailed report.
Our old CDN company was bought out by Akamai and we had to migrate to their platform last week (Full migration completed on Nov 22). Unfortunately, the integration Akamai provided subtly (and no so subtly) failing us in many ways.
I'll go through the configuration to see if I can identify differences in how automatic compression is happening.
Just so you are aware, though, we do some funky stuff with the .br
extension as a workaround for certain Unity Exports. Here's the documentation on the expected behavior:
https://itch.io/docs/creators/html5#compression
If the filename ends with the extension .br then we'll assume that the content is Brotli compressed and the content-encoding will bet set to br. The The content-type header of the file will then be detected and set by the extension, after removing the .br. (Note: Brotli encoding can not be detected like gzip, so we must depend on the .br extension). This approach is commonly used by Unity 2020 WebGL export.
https://github.com/itchio/zipserver/blob/master/zipserver/archive.go#L326
Recently html games that are written in Blazor/Wasm stopped working. The reported game is https://kwyrky.itch.io/blazorwasmgame1 My own game has the same issue: https://nkast.itch.io/alienexterminator
Those games were written in KNI, a C# game framework, and make use of the decode.js library to uncompressed the *.br files generated by Blazor webassembly. host-and-deploy webassembly-compression
The error occurs in this line where BrotliDecode(...) is called to decompress '_framework/blazor.boot.json.br'. decode.js throws a '"Corrupted padding bits"'
Http-Request
Http-Response