New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitelisted requests still raise errors if response code is not successful #131
Comments
Your interpretation of the whitelist seems correct. Can you show me your full Billy config? Not sure about the blocking issue. I know it was difficult to bubble up errors initially but haven't heard any issues before now. |
This is the entire configuration:
Using this, even when requests are sent to an |
Ah ha, I see why now. It's here: https://github.com/oesmith/puffing-billy/blob/master/lib/billy/handlers/proxy_handler.rb#L34-L40. It always logs what the status code is for non-successful cases. This was added because people were having issues with redirects or 404s being cached silently. Perhaps we should change it to |
Since whitelisted requests are never cached, this shouldn't be an issue in that case. Shouldn't they also bypass everything else the proxy handler normally does? That was my expectation when I initially read the docs. (I might want to raise an error if I call an external service and it 404s, but if the local API on my test server issues a redirect or 404, that might be a necessary part of its operation that I want to be able to test without raising an error) |
Since puffing-billy's implementation is as a driver proxy, all URLs go through the proxy handler or else they won't be fetched at all. The only exception is localhost/127.0.0.1 because of an open issue with phantomjs. We could add a whitelist check to |
That sounds like a good approach to me! Or perhaps the "bypass normal processing for whitelisted requests" could happen at a higher level, so that if any additional things (like the allowed-response-codes filter) are added later, whitelisting will also bypass those. |
@Grantovich is this issue still something you'd like to see resolved? |
@ronwsmith Thanks for following up! I haven't worked on any projects that use |
Closing, stale issue. I can reopen if someone else runs into the same issue. |
I'm working on a project that uses subdomains extensively, so in our test environment the app host is
lvh.me
, an internet domain with wildcard DNS that resolves to 127.0.0.1. Following the advice of the README, which says:...I have added
/lvh\.me/
to Billy's whitelist. However, requests to the test server are still being logged as warnings if the response is a redirect or a 4xx, or blocked outright ifnon_successful_error_level
is set to:error
, which causes tests to fail. Shouldn't the whitelist cause the test server to be exempt from these checks? Or is the whitelist not supposed to be used for something like this?(on a related note, I never saw any actual errors raised when setting
non_successful_error_level
to:error
– requests were just getting silently blocked, and I had to dig through the logs to figure out what was going on. are there any known issues with this?)The text was updated successfully, but these errors were encountered: