mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
padreadonly: Remove dead /ro/:id
handling
Read-only pads are accessed using `/p/` path since commit
ba3430ebb7
.
This commit is contained in:
parent
d58b649c76
commit
58bd96ce8f
2 changed files with 0 additions and 33 deletions
|
@ -50,12 +50,6 @@
|
||||||
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/padurlsanitize"
|
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/padurlsanitize"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "padreadonly",
|
|
||||||
"hooks": {
|
|
||||||
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/padreadonly"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "webaccess",
|
"name": "webaccess",
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const readOnlyManager = require('../../db/ReadOnlyManager');
|
|
||||||
const hasPadAccess = require('../../padaccess');
|
|
||||||
const exporthtml = require('../../utils/ExportHtml');
|
|
||||||
|
|
||||||
exports.expressCreateServer = (hookName, args, cb) => {
|
|
||||||
// serve read only pad
|
|
||||||
args.app.get('/ro/:id', async (req, res) => {
|
|
||||||
// translate the read only pad to a padId
|
|
||||||
const padId = await readOnlyManager.getPadId(req.params.id);
|
|
||||||
if (padId == null) {
|
|
||||||
res.status(404).send('404 - Not Found');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// we need that to tell hasPadAcess about the pad
|
|
||||||
req.params.pad = padId;
|
|
||||||
|
|
||||||
if (await hasPadAccess(req, res)) {
|
|
||||||
// render the html document
|
|
||||||
const html = await exporthtml.getPadHTMLDocument(padId, null);
|
|
||||||
res.send(html);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return cb();
|
|
||||||
};
|
|
Loading…
Add table
Add a link
Reference in a new issue