Skip to content

Commit

Permalink
fix(core): do not cache non-json responses in local storage (#5124)
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry committed Apr 6, 2018
1 parent 18d9ba8 commit 3bc5b15
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/scripts/modules/core/src/cache/deckCache.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ class SelfClearingLocalStorage implements ILocalStorage {
try {
if (k.includes(SETTINGS.gateUrl)) {
const response = JSON.parse(v);
if (response.value && Array.isArray(response.value) && (response.value.length > 2) && Array.isArray(response.value[2])) {

const val: any = response.value[2]['content-type'];
if (response.value && Array.isArray(response.value) && (response.value.length > 2) && response.value[2]['content-type']) {
const val: string = response.value[2]['content-type'];
if (val && !val.includes('application/json')) {
return;
}
Expand Down

0 comments on commit 3bc5b15

Please sign in to comment.