mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
Fixed api header authorization (#6399)
This commit is contained in:
parent
8cd2ed07ba
commit
63e9b2d4eb
4 changed files with 4848 additions and 3834 deletions
8677
pnpm-lock.yaml
8677
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -153,6 +153,7 @@ type APIFields = {
|
|||
api_key: string;
|
||||
padID: string;
|
||||
padName: string;
|
||||
authorization: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -179,7 +180,7 @@ exports.handle = async function (apiVersion: string, functionName: string, field
|
|||
}
|
||||
|
||||
if (apikey !== null && apikey.trim().length > 0) {
|
||||
fields.apikey = fields.apikey || fields.api_key;
|
||||
fields.apikey = fields.apikey || fields.api_key || fields.authorization;
|
||||
// API key is configured, check if it is valid
|
||||
if (fields.apikey !== apikey!.trim()) {
|
||||
throw new createHTTPError.Unauthorized('no or wrong API Key');
|
||||
|
|
|
@ -756,7 +756,6 @@ const lookupEnvironmentVariables = (obj: MapArrayType<any>) => {
|
|||
|
||||
//console.log(root.collectFromLeafsUpwards())
|
||||
const rooting = root.collectFromLeafsUpwards()
|
||||
console.log("Rooting is", rooting.ADMIN)
|
||||
obj = Object.assign(obj, rooting)
|
||||
return obj;
|
||||
};
|
||||
|
|
|
@ -70,7 +70,6 @@ const tsortTest = () => {
|
|||
];
|
||||
|
||||
let sorted = tsort(edges);
|
||||
console.log(sorted);
|
||||
|
||||
// example 2: failure ( A > B > C > A )
|
||||
edges = [
|
||||
|
|
Loading…
Reference in a new issue