Skip to content

Commit

Permalink
cache methods on Config were not returning the config for the builder…
Browse files Browse the repository at this point in the history
… pattern.
  • Loading branch information
ryber committed Dec 4, 2020
1 parent ddfc01b commit 36e7480
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 3.11.06 (pending)
* add a convenience method for setting the content type
* add a common reference to popular mime types
* cache methods on Config were not returning the config for the builder pattern.

## 3.11.05
* issue #383 some problems with relocated packages.
Expand Down
8 changes: 6 additions & 2 deletions unirest/src/main/java/kong/unirest/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -583,21 +583,25 @@ public Config cookieSpec(String policy) {
/**
* Enable Response Caching with default options
* @param value enable or disable response caching
* @return this config object
*/
public void cacheResponses(boolean value) {
public Config cacheResponses(boolean value) {
if(value){
this.cache = new CacheManager();
} else {
this.cache = null;
}
return this;
}

/**
* Enable Response Caching with custom options
* @param value enable or disable response caching
* @return this config object
*/
public void cacheResponses(Cache.Builder value) {
public Config cacheResponses(Cache.Builder value) {
this.cache = value.build();
return this;
}

/**
Expand Down

0 comments on commit 36e7480

Please sign in to comment.