Added back the allowed versions list #1
@@ -11,7 +11,19 @@ export const handler = async ({ request, set }: Context) => {
|
|||||||
const requester = request.headers.get('Requester') ?? '0'
|
const requester = request.headers.get('Requester') ?? '0'
|
||||||
const clientVersion = request.headers.get('ClientVersion') ?? '0'
|
const clientVersion = request.headers.get('ClientVersion') ?? '0'
|
||||||
|
|
||||||
if (requester === 'BerryDashGodotClient') return 'all;1.0.0'
|
if (requester === 'BerryDashGodotClient') {
|
||||||
|
const allowedVersions = ["1.0.0", "1.1.0"]
|
||||||
|
|
||||||
|
let permissions = "all"
|
||||||
|
|
||||||
|
if (allowedVersions.indexOf(clientVersion) !== -1) {
|
||||||
|
permissions = "all"
|
||||||
|
} else {
|
||||||
|
permissions = "client"
|
||||||
|
}
|
||||||
|
|
||||||
|
return permissions + ';' + allowedVersions[allowedVersions.length - 1]
|
||||||
|
|
|||||||
|
}
|
||||||
else if (isLatestVersion(clientVersion)) return '1'
|
else if (isLatestVersion(clientVersion)) return '1'
|
||||||
else if (isBetaVersion(clientVersion)) return '4'
|
else if (isBetaVersion(clientVersion)) return '4'
|
||||||
else if (
|
else if (
|
||||||
|
|||||||
Reference in new issue
Block a user
Could you make this instead of hard coding that value, that it will just get the last entry in the array?
Also I do know that would be changed each time, but I would rather it not be duplicated.