File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/main/java/com/ning/http/client/oauth Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 17
17
package com .ning .http .client .oauth ;
18
18
19
19
import com .ning .http .util .UTF8Codec ;
20
+ import com .ning .http .util .UTF8UrlEncoder ;
20
21
21
22
import javax .crypto .Mac ;
22
23
import javax .crypto .spec .SecretKeySpec ;
@@ -36,7 +37,7 @@ public class ThreadSafeHMAC {
36
37
private final Mac mac ;
37
38
38
39
public ThreadSafeHMAC (ConsumerKey consumerAuth , RequestToken userAuth ) {
39
- byte [] keyBytes = UTF8Codec .toUTF8 (consumerAuth .getSecret () + "&" + userAuth .getSecret ());
40
+ byte [] keyBytes = UTF8Codec .toUTF8 (UTF8UrlEncoder . encode ( consumerAuth .getSecret ()) + "&" + UTF8UrlEncoder . encode ( userAuth .getSecret () ));
40
41
SecretKeySpec signingKey = new SecretKeySpec (keyBytes , HMAC_SHA1_ALGORITHM );
41
42
42
43
// Get an hmac_sha1 instance and initialize with the signing key
You can’t perform that action at this time.
0 commit comments