Skip to content

Commit

Permalink
🐛 Clear the entire Develry.Request.cache as soon as a non-GET reque…
Browse files Browse the repository at this point in the history
…st is made
  • Loading branch information
skerit committed Feb 20, 2024
1 parent 7c7f9f1 commit 757a643
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.2 (WIP)

* Clear the entire `Develry.Request.cache` as soon as a non-GET request is made

## 0.9.1 (2024-02-19)

* Rewrite JavaScript tokenizer to no longer use regexes
Expand Down
7 changes: 6 additions & 1 deletion lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ Request.setMethod(function setHeader(name, value) {
*
* @author Jelle De Loecker <[email protected]>
* @since 0.2.0
* @version 0.8.15
* @version 0.9.2
*
* @return {Pledge}
*/
Expand Down Expand Up @@ -507,6 +507,11 @@ Request.setMethod(function start() {
}
}

// If it is not a GET, clear the entire cache
if (this.method != 'GET') {
Request.cache.clear();
}

// Do the response, follow redirects
pledge = this[MAKE_REQUEST](key);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "protoblast",
"description": "Native object expansion library",
"version": "0.9.1",
"version": "0.9.2-alpha",
"author": "Jelle De Loecker <[email protected]>",
"keywords": [
"prototype",
Expand Down

0 comments on commit 757a643

Please sign in to comment.