pmusolino / Wormholy

iOS network debugging, like a wizard 🧙‍♂️
MIT License
2.32k stars 184 forks source link

[Feature Request] Exclude URLs from caching response data #49

Closed danielaRiesgo closed 4 years ago

danielaRiesgo commented 5 years ago

It would be nice to be able to tell Wormholy which URLs to ignore from saving response data to memory. We use it in our current project and we were downloading some big files, until we realized that Wormholy was storing that data in memory for the request history. We kept Wormholy but had to tweak it to avoid this (CustomHTTPProtocol.swift file, urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) function implementation).

It would be ideal to have this array of URL to ignore (or in fact, URL regex to ignore), and maybe if it's useful for someone, URL to ignore completely (request and response).

pmusolino commented 5 years ago

Hi @danielaRiesgo! Thanks for reporting this feedback. I will soon implement this feature, perhaps via a custom .plist file.

colinhumber commented 4 years ago

We needed the ability to ignore certain hosts as well. I made a PR here where you can specify blacklisted hosts like so. Any subdomains will be ignored as well:

Wormholy.blacklistedHosts = ["host1.com", "host2.com"]
pmusolino commented 4 years ago

Reference: https://github.com/pmusolino/Wormholy/pull/65