parent
0308d18107
commit
f82f8764cf
|
@ -22,8 +22,7 @@ public class ManagedWebAccessBuilder extends ManagedWebAccessBuilderBase<Managed
|
|||
}
|
||||
|
||||
private Map<String, String> newHeaders() {
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
headers.putAll(this.getHeaders());
|
||||
Map<String, String> headers = new HashMap<String, String>(this.getHeaders());
|
||||
if (getAuthenticationMode() == HTTPAuthenticationMode.TOKEN) {
|
||||
headers.put("Authorization", "Bearer " + getToken());
|
||||
} else if (getAuthenticationMode() == HTTPAuthenticationMode.BASIC) {
|
||||
|
@ -35,7 +34,6 @@ public class ManagedWebAccessBuilder extends ManagedWebAccessBuilderBase<Managed
|
|||
if (getUserAgent() != null) {
|
||||
headers.put("User-Agent", getUserAgent());
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ public class SimpleHTTPClient {
|
|||
private void setAuthenticationHeader(HttpURLConnection c) {
|
||||
String authHeaderValue = null;
|
||||
if (authenticationMode == HTTPAuthenticationMode.TOKEN) {
|
||||
authHeaderValue = "Bearer " + new String(token);
|
||||
authHeaderValue = "Bearer " + token;
|
||||
} else if (authenticationMode == HTTPAuthenticationMode.BASIC) {
|
||||
String auth = username+":"+password;
|
||||
byte[] encodedAuth = Base64.getEncoder().encode(auth.getBytes(StandardCharsets.UTF_8));
|
||||
|
|
Loading…
Reference in New Issue