Comments (7)
That config option manipulates the GET query string for the cache.
I think the fix you're looking for would be in the cache key generation here: https://github.com/oesmith/puffing-billy/blob/master/lib/billy/cache.rb#L80.
Seems like you want to remove keys from the request body before using the body to generate the cache key.
Want to take a stab at adding a new config option for that?
from puffing-billy.
Actually, all of these parameters are in the URL. The gem uses Faraday for the requests, so I'm guessing putting the parameters in the URL is part of Faraday's implementation. Is this unusual? If so, is it too unusual to justify adding support for removing nested keys?
from puffing-billy.
@michaelrkn, whoa, Balanced Payments sends credit card details in the GET query string? That violates nearly every rule about when to use a GET. I haven't seen nested GET params in a very long time and have reservations about helping enable Balanced Payments' poor architecture if that's indeed the case.
from puffing-billy.
Because the balanced.js library uses JSONP, it creates an async <script>
tag to send the information and execute the callback:
function jsonp(path, callback) {
var funct = "balanced_jsonp_" + Math.random().toString().substr(2);
var tag = document.createElement("script");
tag.type = "text/javascript";
tag.async = true;
tag.src = path.replace("{callback}", funct);
var where = document.getElementsByTagName("script")[0];
where.parentNode.insertBefore(tag, where);
window[funct] = function(result) {
try {
callback(result);
} catch (e) {
if (typeof console !== "undefined" && console.error) {
console.error(e);
}
}
tag.parentNode.removeChild(tag);
};
}
So, yes, it is performing a GET request, but that's because it's using JSONP. Honestly, I didn't actually understand how JSONP until doing a bit of research just now, but this seems to be the standard way to make requests with JSONP.
from puffing-billy.
@michaelrkn, is this still an issue? I see that the related issue in your repo was closed in June.
from puffing-billy.
We switched from Balanced to Stripe and no longer need to ignore nested keys. I have no idea if Puffing Billy supports this now, but my feelings won't be hurt if you decide this isn't important and close the issue :)
from puffing-billy.
I'll close it for now until another Balanced user runs into the same issue.
from puffing-billy.
Related Issues (20)
- question: mocking images HOT 1
- specify verify_peer option to EM::HttpRequest HOT 2
- click on select option, then click a button, billy driver not working, but default driver working. HOT 5
- Proxy errors in Docker + Headless Chrome + Selenium HOT 2
- New requests being recorded on each run HOT 3
- How to correctly cache requests with metadata that changes on each request HOT 2
- Resources link to Stripe integration is dead HOT 1
- Request fails: Errno::ECONNREFUSED HOT 9
- Can there be a feature to save requests as HAR files? HOT 4
- Feature request: instructions for using with selenium grid HOT 4
- PB ignoring localhost requests HOT 2
- Net::ReadTimeout HOT 10
- Puffing Billy Receiving Requests but not Responses from Firefox
- Contributions HOT 1
- Include lib/tasks/billy.rake HOT 7
- i want to try
- cuprite driver support ? HOT 5
- Breaks when upgrading selenium-webdriver from 4.10.0 to 4.11.0 (`headless!`) HOT 1
- Filter sensitive data out of cache
- Not working with Ruby 3.3.0, because "em-http-request" require dead "cookiejar" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puffing-billy.