mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-22 06:45:08 -04:00
More robust handling of prompt tag filtering
This commit is contained in:
1 parent
b2ebeeea70
commit
6b3dee759d
1 file changed
+7
-1
@@ -4,7 +4,13 @@ module.exports.responseHooks = [
|
||||
async context => {
|
||||
const items = await context.store.all();
|
||||
const requestId = context.request.getId();
|
||||
const toRemove = items.filter(v => v.key.indexOf(requestId) === 0);
|
||||
const toRemove = items.filter(v => {
|
||||
if (v.key && typeof v.key === 'string') {
|
||||
return v.key.indexOf(requestId) === 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
// Delete cached values we prompt again on the next request
|
||||
for (const { key } of toRemove) {
|
||||
await context.store.removeItem(key);
|
||||
|
||||
Reference in new issue
Block a user