Update importexport.ts - fixes 4805

This changes the export from doc to docx.
A lot of other projects (like BBB) rely on etherpad lite, but nobody seemed to care about :-)
This commit is contained in:
lonesomewalker 2025-04-07 21:33:10 +02:00 committed by GitHub
parent 65949b60f2
commit e880145b6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,7 +28,7 @@ exports.expressCreateServer = (hookName:string, args:ArgsExpressType, cb:Functio
args.app.use('/p/:pad/:rev?/export/:type', limiter); args.app.use('/p/:pad/:rev?/export/:type', limiter);
args.app.get('/p/:pad/:rev?/export/:type', (req:any, res:any, next:Function) => { args.app.get('/p/:pad/:rev?/export/:type', (req:any, res:any, next:Function) => {
(async () => { (async () => {
const types = ['pdf', 'doc', 'txt', 'html', 'odt', 'etherpad']; const types = ['pdf', 'docx', 'txt', 'html', 'odt', 'etherpad'];
// send a 404 if we don't support this filetype // send a 404 if we don't support this filetype
if (types.indexOf(req.params.type) === -1) { if (types.indexOf(req.params.type) === -1) {
return next(); return next();
@ -36,7 +36,7 @@ exports.expressCreateServer = (hookName:string, args:ArgsExpressType, cb:Functio
// if abiword is disabled, and this is a format we only support with abiword, output a message // if abiword is disabled, and this is a format we only support with abiword, output a message
if (settings.exportAvailable() === 'no' && if (settings.exportAvailable() === 'no' &&
['odt', 'pdf', 'doc'].indexOf(req.params.type) !== -1) { ['odt', 'pdf', 'docx'].indexOf(req.params.type) !== -1) {
console.error(`Impossible to export pad "${req.params.pad}" in ${req.params.type} format.` + console.error(`Impossible to export pad "${req.params.pad}" in ${req.params.type} format.` +
' There is no converter configured'); ' There is no converter configured');