Skip to content

Commit

Permalink
Fix configuration access error (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
q1zZu authored Feb 17, 2024
2 parents 268d60a + 83e7f5b commit 3e3d2aa
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions client/src/main/java/me/q1zz/spaceis/sdk/SpaceIsSdkClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,16 @@ public SpaceIsSdkClient(@NotNull String apiKey) {
/**
* Constructs a SpaceIsSdkClient instance with the provided base URL and API key.
*
* @param baseUrl the base URL of the SpaceIs API
* @param apiKey the API key used for authentication
* @param baseUrl the base URL of the SpaceIs API
*/
public SpaceIsSdkClient(@NotNull String baseUrl, @NotNull String apiKey) {
this(new Config()
this.unirest = new UnirestInstance(new Config()
.defaultBaseUrl(baseUrl)
.addDefaultHeader("Authorization", "Bearer " + apiKey)
);
}

/**
* Constructs a SpaceIsSdkClient instance with the provided configuration for Unirest.
*
* @param config the configuration for the Unirest instance used by the SpaceIsSdkClient
*/
public SpaceIsSdkClient(@NotNull Config config) {
this.unirest = new UnirestInstance(config
.addDefaultHeader("User-Agent", USER_AGENT)
.addDefaultHeader("Content-Type", "application/json")
.addDefaultHeader("Accept", "application/json")
.addDefaultHeader("Authorization", "Bearer " + apiKey)
.connectTimeout(5000)
.enableCookieManagement(false)
);
Expand Down

0 comments on commit 3e3d2aa

Please sign in to comment.