mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
express: Move static handlers to expressPreSession
This avoids the need to exempt the paths from authentication checks, and it eliminates unnecessary express-session state.
This commit is contained in:
parent
72f4ae444d
commit
649fbdccf5
10 changed files with 65 additions and 85 deletions
|
@ -540,9 +540,7 @@ const generateDefinitionForVersion = (version, style = APIPathStyle.FLAT) => {
|
|||
return definition;
|
||||
};
|
||||
|
||||
exports.expressCreateServer = (hookName, args, cb) => {
|
||||
const {app} = args;
|
||||
|
||||
exports.expressPreSession = async (hookName, {app}) => {
|
||||
// create openapi-backend handlers for each api version under /api/{version}/*
|
||||
for (const version of Object.keys(apiHandler.version)) {
|
||||
// we support two different styles of api: flat + rest
|
||||
|
@ -690,7 +688,6 @@ exports.expressCreateServer = (hookName, args, cb) => {
|
|||
});
|
||||
}
|
||||
}
|
||||
return cb();
|
||||
};
|
||||
|
||||
// helper to get api root
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue