patch matrix-bot-sdk to fix compatibility with synapse 1.90+

This commit is contained in:
Robin Appelman 2023-10-05 17:58:44 +02:00
commit f1c74277ac
4 changed files with 762 additions and 3 deletions

View file

@ -18,7 +18,16 @@
in rec {
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [nodejs.pkgs.node-pre-gyp nodejs.pkgs.node-gyp-build pkg-config which nodePackages.typescript python3];
nativeBuildInputs = with pkgs; [
nodejs
nodejs.pkgs.node-pre-gyp
nodejs.pkgs.node-gyp-build
pkg-config
which
nodePackages.typescript
python3
nodePackages.patch-package
];
buildInputs = with pkgs; [libjpeg pixman cairo pango postgresql];
};
});

733
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,8 @@
"build": "tsc",
"lint": "tslint --project ./tsconfig.json -t stylish",
"start": "npm run-script build && node ./build/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"postinstall": "patch-package"
},
"author": "Icewind",
"dependencies": {
@ -27,6 +28,7 @@
"@types/gif-encoder": "^0.7.0",
"@types/node": "^14.14.22",
"@types/steamid": "^2.0.0",
"patch-package": "^8.0.0",
"typescript": "^4.1.3"
}
}

View file

@ -0,0 +1,15 @@
diff --git a/node_modules/@sorunome/matrix-bot-sdk/lib/appservice/Appservice.js b/node_modules/@sorunome/matrix-bot-sdk/lib/appservice/Appservice.js
index f8c7d70..8c8c3b6 100644
--- a/node_modules/@sorunome/matrix-bot-sdk/lib/appservice/Appservice.js
+++ b/node_modules/@sorunome/matrix-bot-sdk/lib/appservice/Appservice.js
@@ -397,8 +397,8 @@ class Appservice extends events_1.EventEmitter {
}
isAuthed(req) {
let providedToken = req.query ? req.query["access_token"] : null;
- if (req.headers && req.headers["Authorization"]) {
- const authHeader = req.headers["Authorization"];
+ if (req.headers && req.headers["authorization"]) {
+ const authHeader = req.headers["authorization"];
if (!authHeader.startsWith("Bearer "))
providedToken = null;
else