Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Breaking S3 Changes #4129

Open
wants to merge 2 commits into
base: v3.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public boolean write(long hash, BufferOutputStream encImage, long timestamp) {
else {
PutObjectRequest req = PutObjectRequest.builder().bucketName(bucketname).key(baseKey).contentType(map.getImageFormat().getEncoding().getContentType())
.addMetadata("x-dynmap-hash", Long.toHexString(hash)).addMetadata("x-dynmap-ts", Long.toString(timestamp)).build();
s3.putObject(req, RequestBody.fromBytes(encImage.buf));
s3.putObject(req, RequestBody.fromBytes(Arrays.copyOfRange(encImage.buf, 0, encImage.len)));
}
done = true;
} catch (S3Exception x) {
Expand Down Expand Up @@ -529,7 +529,7 @@ public boolean setPlayerFaceImage(String playername, FaceType facetype,
}
else {
PutObjectRequest req = PutObjectRequest.builder().bucketName(bucketname).key(baseKey).contentType("image/png").build();
s3.putObject(req, RequestBody.fromBytes(encImage.buf));
s3.putObject(req, RequestBody.fromBytes(Arrays.copyOfRange(encImage.buf, 0, encImage.len)));
}
done = true;
} catch (S3Exception x) {
Expand Down Expand Up @@ -582,7 +582,7 @@ public boolean setMarkerImage(String markerid, BufferOutputStream encImage) {
}
else {
PutObjectRequest req = PutObjectRequest.builder().bucketName(bucketname).key(baseKey).contentType("image/png").build();
s3.putObject(req, RequestBody.fromBytes(encImage.buf));
s3.putObject(req, RequestBody.fromBytes(Arrays.copyOfRange(encImage.buf, 0, encImage.len)));
}
done = true;
} catch (S3Exception x) {
Expand Down Expand Up @@ -745,7 +745,7 @@ else if (fileid.endsWith(".js")) {
ct = "application/x-javascript";
}
PutObjectRequest req = PutObjectRequest.builder().bucketName(bucketname).key(baseKey).contentType(ct).build();
s3.putObject(req, RequestBody.fromBytes(content.buf));
s3.putObject(req, RequestBody.fromBytes(Arrays.copyOfRange(content.buf, 0, content.len)));
standalone_cache.put(fileid, digest);
}
done = true;
Expand Down