[FIX] JsonAuthCoreProvider Bearer header

This commit is contained in:
Gravita 2021-08-23 15:56:08 +07:00
parent 93fdd7f899
commit fb7a552843

View file

@ -58,7 +58,7 @@ public static <T, R> R jsonRequest(T request, String url, String bearerToken, Cl
.header("Accept", "application/json") .header("Accept", "application/json")
.timeout(Duration.ofMillis(10000)); .timeout(Duration.ofMillis(10000));
if (bearerToken != null) { if (bearerToken != null) {
request1.header("Authentication", "Bearer ".concat(bearerToken)); request1.header("Authorization", "Bearer ".concat(bearerToken));
} }
HttpResponse<InputStream> response = client.send(request1.build(), HttpResponse.BodyHandlers.ofInputStream()); HttpResponse<InputStream> response = client.send(request1.build(), HttpResponse.BodyHandlers.ofInputStream());
int statusCode = response.statusCode(); int statusCode = response.statusCode();