Skip to content

Commit

Permalink
prevent caching null response
Browse files Browse the repository at this point in the history
  • Loading branch information
deven96 committed Apr 15, 2021
1 parent ef2101f commit e17b774
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ pub mod cached_reqwest {
let (mut file, contents) = create_or_retrieve(concat_url, exe_path);
// if file is empty then cache does not exist
// then retrieve directly using reqwest
if (contents.as_str()).eq("") || (contents.as_str()).eq("error code: 1020") {
if (contents.as_str()).eq("") ||
(contents.as_str()).eq("error code: 1020") ||
(contents.as_str()).eq("({\"response\":null});"){
let res = reqwest::Client::new()
.post(url)
.form(&params)
Expand Down

0 comments on commit e17b774

Please sign in to comment.