Skip to content

Commit

Permalink
https://github.com/manifold-systems/manifold/issues/541
Browse files Browse the repository at this point in the history
- fix withAuthorization()
  • Loading branch information
rsmckinney committed Jan 8, 2024
1 parent c700360 commit 8576150
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public Executor<T> withBearerAuthorization( String accessToken )
@SuppressWarnings("unused")
public Executor<T> withAuthorization( String tokenType, String accessToken )
{
return withHeader( "Authorization", "$tokenType $accessToken" );
return withHeader( "Authorization", tokenType + " " + accessToken );
}
/**
* The connection timeout setting in milliseconds. If the timeout expires before the connection can be established, a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ public Requester<T> withParam( String name, String value )
public Requester<T> withBasicAuthorization( String username, String password )
{
String authorization = Base64.getEncoder()
.encodeToString(( "$username:$password" ).getBytes( StandardCharsets.UTF_8 ) );
return withHeader( "Authorization", "Basic $authorization" );
.encodeToString(( username + ":" + password ).getBytes( StandardCharsets.UTF_8 ) );
return withHeader( "Authorization", "Basic " + authorization );
}

/**
Expand All @@ -194,7 +194,7 @@ public Requester<T> withBearerAuthorization( String accessToken )
@SuppressWarnings("unused")
public Requester<T> withAuthorization( String tokenType, String accessToken )
{
return withHeader( "Authorization", "$tokenType $accessToken" );
return withHeader( "Authorization", tokenType + " " + accessToken );
}

/**
Expand Down

0 comments on commit 8576150

Please sign in to comment.