Dynmap-Forge/Fabric

Dynmap-Forge/Fabric

888k Downloads

Hosting on S3 - Null control characters at EOF

kiwikodes opened this issue ยท 0 comments

commented

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.

  • Dynmap Version: 3.7-SNAPSHOT-949
  • Server Version: fabric 1.21 (presumably all other versions also)
  • Other Relevant Data/Screenshots:
    Screenshot of S3 file sizes
    image
    Screenshot of null control characters at end of file
    image
    Steps to Replicate:
  1. Change configuration.txt to host files on an S3 bucket
  2. Run Dynmap as per usual, and try to view the static site from S3 bucket

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).