Release v1.4.35 with 413 handling for both dcrypt endpoints
- Handle 413 from paste endpoint (not just upload) - Show clear German error "DLC-Datei zu groß für dcrypt.it" when both endpoints reject the file due to size - Add tests for dual-413 and upload-413+paste-500 scenarios Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
778124312c
commit
48c89713ba
@@ -190,7 +190,7 @@ async function tryDcryptUpload(fileContent: Buffer, fileName: string): Promise<s
|
||||
return extractLinksFromResponse(text);
|
||||
}
|
||||
|
||||
async function tryDcryptPaste(fileContent: Buffer): Promise<string[]> {
|
||||
async function tryDcryptPaste(fileContent: Buffer): Promise<string[] | null> {
|
||||
const form = new FormData();
|
||||
form.set("content", fileContent.toString("ascii"));
|
||||
|
||||
@@ -198,6 +198,9 @@ async function tryDcryptPaste(fileContent: Buffer): Promise<string[]> {
|
||||
method: "POST",
|
||||
body: form
|
||||
});
|
||||
if (response.status === 413) {
|
||||
return null;
|
||||
}
|
||||
const text = await response.text();
|
||||
if (!response.ok) {
|
||||
throw new Error(compactErrorText(text));
|
||||
@@ -214,6 +217,9 @@ async function decryptDlcViaDcrypt(filePath: string): Promise<ParsedPackageInput
|
||||
if (links === null) {
|
||||
links = await tryDcryptPaste(fileContent);
|
||||
}
|
||||
if (links === null) {
|
||||
throw new Error("DLC-Datei zu groß für dcrypt.it");
|
||||
}
|
||||
if (links.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user