-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Carrierwave download of external url #2695
Description
Problem
Hello everyone 👋
I am facing errors from Webmock and VCR where specs fail with an unhandled web request error. e.g. UnhandledHTTPRequestError or NetConnectNotAllowedError.
During my investigation I noticed that those unhandled web requests are caused by the download! method. This method gets called if an external_url is present. Which is here the case.
Question
My goal is to have an offline test suite, therefore, I was a bit surprised about this behavior, since I set enable_processing to false.
I solved the offline approach by mocking all requests:
- Prevent IP resolving -> Overwrite the
SsrfFilter::DEFAULT_RESOLVERAdd way to globally disable filter arkadiyt/ssrf_filter#33 (comment) - Mock the external_url URI request -> webmock/vcr
Currently, I am unsure if this is the best approach or if carrierwave should handle this automatically depending on the enable_processing setting. Especially since setting enable_processing to false causes an early exit anyway.