fix: update dropbox sharing link to the new version

This commit is contained in:
Christian Vidal Wolf
2026-04-22 16:17:07 +02:00
parent eec500f737
commit 81f0e76c3b
2 changed files with 15 additions and 3 deletions
+9 -2
View File
@@ -42,14 +42,21 @@ export default async function handler(req, res) {
}
try {
const sharingUrl = 'https://www.dropbox.com/scl/fi/ulcgt5iyyvrkeynprhali/Data-Matrix.xlsx?rlkey=i9p9xgwzm0fr7jip91vxdeal5&st=k8jmibh4&dl=1';
const sharingUrl = 'https://www.dropbox.com/scl/fi/8qbl7uoigtfu5x1nn8wvm/Data-Matrix.xlsx?rlkey=s6rkwa2bjrx9gh442gw6w40uk&dl=1';
const upstream = await fetch(sharingUrl, {
method: 'GET',
headers: {
'Cache-Control': 'no-cache'
'Cache-Control': 'no-cache',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}
});
const contentType = upstream.headers.get('content-type');
if (contentType && contentType.includes('text/html')) {
console.error('Dropbox returned HTML instead of file');
return res.status(500).send('Error: El enlace de Dropbox ha devuelto una página HTML en lugar del archivo. Es probable que el enlace haya caducado o necesite ser renovado.');
}
if (!upstream.ok) {
const errText = await upstream.text();
console.error('Dropbox URL error:', upstream.status, errText);