Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

minor fix

daniel31x13de73777ea214
diff --git a/apps/web/components/Preservation/PreservationContent.tsx b/apps/web/components/Preservation/PreservationContent.tsx
index 7d1cee6c..71f7a3a0 100644
--- a/apps/web/components/Preservation/PreservationContent.tsx
+++ b/apps/web/components/Preservation/PreservationContent.tsx
@@ -228,7 +228,7 @@ export const PreservationContent: React.FC<Props> = ({ link, format }) => {
<img
alt=""
ref={imgRef}
- src={`/api/v1/archives/${link.id}?format=${currentFormat}`}
+ src={`/api/v1/archives/${link.id}?format=${currentFormat}&_=${link.updatedAt}`}
className={clsx("w-fit mx-auto", !imageLoaded && "hidden")}
onLoad={(e) => {
const img = e.currentTarget;
diff --git a/packages/filesystem/createFile.ts b/packages/filesystem/createFile.ts
index 7ab96838..55c838c4 100644
--- a/packages/filesystem/createFile.ts
+++ b/packages/filesystem/createFile.ts
@@ -1,4 +1,5 @@
import { PutObjectCommand, PutObjectCommandInput } from "@aws-sdk/client-s3";
+import crypto from "crypto";
import { promises as fs } from "fs";
import path from "path";
import s3Client from "./s3Client";
@@ -22,10 +23,20 @@ export async function createFile({
}
if (s3Client) {
+ const bytes = new Uint8Array(bufferData);
+
+ let contentMD5: string | undefined;
+ try {
+ contentMD5 = crypto.createHash("md5").update(bytes).digest("base64");
+ } catch (err) {
+ console.warn("Skipping Content-MD5, unable to hash:", err);
+ }
+
const bucketParams: PutObjectCommandInput = {
Bucket: process.env.SPACES_BUCKET_NAME!,
Key: filePath,
- Body: new Uint8Array(bufferData),
+ Body: bytes,
+ ContentMD5: contentMD5,
};
try {