Skip to content

Commit a864cd5

Browse files
fix(RequestHandler): cache by default (#686)
* fix(RequestHandler): cache by default * fix(RequestHandler): cache raw requests
1 parent 5c93ca0 commit a864cd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Private/RequestHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RequestHandler {
2424
noCache: options?.noCache ?? false,
2525
noCacheCheck: options?.noCacheCheck ?? false
2626
};
27-
if (options.noCacheCheck && this.client.cacheHandler.has(endpoint)) {
27+
if (!options.noCacheCheck && this.client.cacheHandler.has(endpoint)) {
2828
const data = this.client.cacheHandler.get(endpoint);
2929
return new RequestData(data.data, data.headers, {
3030
status: 200,
@@ -71,7 +71,7 @@ class RequestHandler {
7171
cached: false
7272
});
7373
if (options.noCache) return requestData;
74-
if (this.client.options.cache && !options.raw) {
74+
if (this.client.options.cache) {
7575
this.client.cacheHandler.set(endpoint, requestData);
7676
}
7777
return requestData;

0 commit comments

Comments
 (0)