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:
Richard Hansen 2021-12-17 17:01:55 -05:00
parent 72f4ae444d
commit 649fbdccf5
10 changed files with 65 additions and 85 deletions

View file

@ -23,7 +23,7 @@
{
"name": "static",
"hooks": {
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/static"
"expressPreSession": "ep_etherpad-lite/node/hooks/express/static"
}
},
{
@ -35,13 +35,14 @@
{
"name": "i18n",
"hooks": {
"expressCreateServer": "ep_etherpad-lite/node/hooks/i18n"
"expressPreSession": "ep_etherpad-lite/node/hooks/i18n"
}
},
{
"name": "specialpages",
"hooks": {
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/specialpages"
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/specialpages",
"expressPreSession": "ep_etherpad-lite/node/hooks/express/specialpages"
}
},
{
@ -53,7 +54,7 @@
{
"name": "apicalls",
"hooks": {
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/apicalls"
"expressPreSession": "ep_etherpad-lite/node/hooks/express/apicalls"
}
},
{
@ -79,7 +80,7 @@
{
"name": "tests",
"hooks": {
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/tests"
"expressPreSession": "ep_etherpad-lite/node/hooks/express/tests"
}
},
{
@ -105,7 +106,7 @@
{
"name": "openapi",
"hooks": {
"expressCreateServer": "ep_etherpad-lite/node/hooks/express/openapi"
"expressPreSession": "ep_etherpad-lite/node/hooks/express/openapi"
}
}
]