lisaogren / axios-cache-adapter

Caching adapter for axios. Store request results in a configurable store to prevent unneeded network requests.
MIT License
726 stars 107 forks source link

nullcheck req.url when doing exclude checks #258

Open mlison opened 3 years ago

mlison commented 3 years ago

Under certain circumstances, the request.url can be undefined which causes exclude checks to throw an error and crash.

If I understand correctly, this only happens with certain (not very popular) browsers or when doing request blocking from dev tools. Nonetheless, a simple nullcheck solves the situation.

codecov[bot] commented 3 years ago

Codecov Report

Merging #258 (3e2325b) into master (2d51cee) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #258   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          235       234    -1     
=========================================
- Hits           235       234    -1     
Impacted Files Coverage Δ
src/exclude.js 100.00% <100.00%> (ø)
src/serialize.js 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2d51cee...3e2325b. Read the comment docs.