ticketlens 0.9.12 → 0.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -83,19 +83,10 @@ export async function downloadAttachments(ticket, opts = {}) {
|
|
|
83
83
|
onProgress?.(` download ${a.filename}`);
|
|
84
84
|
try {
|
|
85
85
|
const headers = buildAuthHeader(env);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} catch (err) {
|
|
91
|
-
// Jira Cloud attachment URLs sometimes redirect to CDN/S3 presigned URLs.
|
|
92
|
-
// On redirect, retry without auth — the presigned URL provides its own authentication.
|
|
93
|
-
if (err?.cause?.message?.includes('redirect mode is set to error')) {
|
|
94
|
-
response = await fetcher(a.content, { redirect: 'follow' });
|
|
95
|
-
} else {
|
|
96
|
-
throw err;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
86
|
+
// Default redirect:'follow' — Jira Cloud attachment URLs may redirect to CDN/S3
|
|
87
|
+
// presigned URLs. The SSRF guard above already validates the initial URL is on
|
|
88
|
+
// the configured Jira origin, which is the relevant security boundary here.
|
|
89
|
+
const response = await fetcher(a.content, { headers });
|
|
99
90
|
if (!response.ok) throw new Error(`HTTP ${response.status} (${response.statusText})`);
|
|
100
91
|
const buffer = await response.arrayBuffer();
|
|
101
92
|
fs.writeFileSync(localPath, Buffer.from(buffer));
|