webbukkit / dynmap

A set of Minecraft mods that provide a real time web-based map system for various Minecraft server implementations.
https://www.reddit.com/r/Dynmap/
Apache License 2.0
2.02k stars 414 forks source link

Hosting on S3 - Null control characters at EOF #4128

Open kiwikodes opened 2 days ago

kiwikodes commented 2 days ago

Issue Description: When using S3 to store Dynmap files, the files round up to the nearest 8KB. This results in null characters at the end of every file, and hence, the files cannot run.

The site runs but complains about all the JS files. The site will just give a completely black screen, no compass or anything.

I believe this bug was introduced in #4030. For some reason, every instance of s3.putObject(req, RequestBody.fromBytes(encImage.buf, encImage.len)); had encImage.len removed. This causes the whole buffer to be written to S3 (including the unwanted null characters).