Skip to content
Closed
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions src/object-uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export async function uploadTarFile(

/**
* Upload a single file (text or binary).
* Always uses 'binary' content type so rage places the file as-is
* instead of extracting it (which it would do for tar/tgz).
*/
export async function uploadSingleFile(
client: RunloopSDK,
Expand All @@ -51,10 +53,7 @@ export async function uploadSingleFile(
const fileBuffer = fs.readFileSync(filePath);
const fileName = path.basename(filePath);

// Determine content type based on file
const contentType = determineContentType(fileName, fileBuffer);

return uploadBuffer(client, fileBuffer, fileName, contentType, ttlDays, isPublic);
return uploadBuffer(client, fileBuffer, fileName, 'binary', ttlDays, isPublic);
}

/**
Expand Down Expand Up @@ -136,7 +135,7 @@ async function uploadBuffer(
/**
* Determine content type based on file characteristics.
*/
function determineContentType(
export function determineContentType(
fileName: string,
buffer: Buffer
): 'text' | 'binary' | 'gzip' | 'tar' | 'tgz' {
Expand Down
Loading