mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
tests: Add authentication, authorization bypass tests
This commit is contained in:
parent
80639fdc6a
commit
9e6d3f3f63
4 changed files with 210 additions and 1 deletions
|
@ -51,6 +51,11 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
var cookieParserFn = cookieParser(webaccess.secret, {});
|
||||
io.use((socket, next) => {
|
||||
var data = socket.request;
|
||||
if (!data.headers.cookie) {
|
||||
// socketio.js-client on node.js doesn't support cookies (see https://git.io/JU8u9), so the
|
||||
// token and express_sid cookies have to be passed via a query parameter for unit tests.
|
||||
data.headers.cookie = socket.handshake.query.cookie;
|
||||
}
|
||||
if (!data.headers.cookie && settings.loadTest) {
|
||||
console.warn('bypassing socket.io authentication check due to settings.loadTest');
|
||||
return next(null, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue