From 9b2e3d052a123fad0429a5edf09a57e641f34900 Mon Sep 17 00:00:00 2001 From: Zxilly Date: Mon, 26 Apr 2021 17:45:14 +0800 Subject: [PATCH] fix: won't reparse the response (#59) Signed-off-by: Zxilly --- src/Authorizer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Authorizer.ts b/src/Authorizer.ts index 6bdad146..e12dc17f 100644 --- a/src/Authorizer.ts +++ b/src/Authorizer.ts @@ -83,7 +83,7 @@ export class Authorizer { } this.permission.load(permission); } - + public async initEnforcer(s: string): Promise { const obj = JSON.parse(s); if (!('m' in obj)) { @@ -107,6 +107,7 @@ export class Authorizer { } const resp = await axios.get(`${this.endpoint}?subject=${this.user}`, { headers: this.requestHeaders, + transformResponse: res => res, }); return resp.data.data; }