@@ -27,49 +27,30 @@ protected BaseAdapter(RequestOptions requestOptions) {
2727 this .requestOptions = requestOptions ;
2828 }
2929
30- protected Map <String , String > createHeaders (Object request , String path , RequestOptions requestOptions ) {
31- return createHttpHeaders (request , path , requestOptions );
30+ protected Map <String , String > createHeaders (Object request , String path ) {
31+ return createHttpHeaders (request , path , null );
3232 }
3333
3434 protected Map <String , String > createHeaders (Object request , String path , RequestContext requestContext ) {
3535 return createHttpHeaders (request , path , requestContext );
3636 }
3737
38- protected Map <String , String > createHeaders (String path , RequestOptions requestOptions ) {
39- return createHttpHeaders (null , path , requestOptions );
38+ protected Map <String , String > createHeaders (String path ) {
39+ return createHttpHeaders (null , path , null );
4040 }
4141
4242 protected Map <String , String > createHeaders (String path , RequestContext requestContext ) {
4343 return createHttpHeaders (null , path , requestContext );
4444 }
4545
46- private static Map <String , String > createHttpHeaders (Object request , String path , RequestOptions options ) {
47- Map <String , String > headers = new HashMap <>();
48-
49- String randomString = UUID .randomUUID ().toString ();
50- headers .put (API_KEY_HEADER_NAME , options .getApiKey ());
51- headers .put (RANDOM_HEADER_NAME , randomString );
52- headers .put (AUTH_VERSION_HEADER_NAME , API_VERSION_HEADER_VALUE );
53- headers .put (CLIENT_VERSION_HEADER_NAME , CLIENT_VERSION_HEADER_VALUE + ":1.0.81" );
54- headers .put (SIGNATURE_HEADER_NAME , prepareAuthorizationString (request , path , randomString , options ));
55- if (Objects .nonNull (options .getLanguage ())) {
56- headers .put (LANGUAGE_HEADER_NAME , options .getLanguage ());
57- }
58- return headers ;
59- }
60-
61- private static String prepareAuthorizationString (Object request , String path , String randomString , RequestOptions options ) {
62- return HashGenerator .generateHash (options .getBaseUrl (), options .getApiKey (), options .getSecretKey (), randomString , request , path );
63- }
64-
6546 private Map <String , String > createHttpHeaders (Object request , String path , RequestContext requestContext ) {
6647 Map <String , String > headers = new HashMap <>();
6748
6849 String randomString = UUID .randomUUID ().toString ();
6950 headers .put (API_KEY_HEADER_NAME , requestOptions .getApiKey ());
7051 headers .put (RANDOM_HEADER_NAME , randomString );
7152 headers .put (AUTH_VERSION_HEADER_NAME , API_VERSION_HEADER_VALUE );
72- headers .put (CLIENT_VERSION_HEADER_NAME , CLIENT_VERSION_HEADER_VALUE + ":1.0.79 " );
53+ headers .put (CLIENT_VERSION_HEADER_NAME , CLIENT_VERSION_HEADER_VALUE + ":1.0.81 " );
7354 headers .put (SIGNATURE_HEADER_NAME , prepareAuthorizationString (request , path , randomString ));
7455 if (Objects .nonNull (requestOptions .getLanguage ())) {
7556 headers .put (LANGUAGE_HEADER_NAME , requestOptions .getLanguage ());
0 commit comments