-
Notifications
You must be signed in to change notification settings - Fork 32
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
Duplicate Requests being recorded #12
Comments
Hi @jameseisenhauer: Sorry for the delay, but unfortunately, without knowing the exact tools you're using (which proxy server?), I wouldn't be able to answer the question. Could you check if the proxy is actually making two outbound requests or just one? |
I found out what was writing the request twice. It is this line in the cache file: ['http', 'https'].forEach(function(protocol) { I am using nodejitsu http-proxy so on a http-->https proxy it seems to be sending both objects. Can you recommend a way to only run https if it and http objects exist without impacting the rest of the code? Today I plan to dig into it and test out a few ideas. thanks! |
I'm not using a proxy at all and I am seeing this behavior |
Yeah the sepia library in cache.js seems to be making 2 requests like @jimmyeisenhauer mentions |
I was just looking at this in the replayer fork. What's happening is that the function is being wrapped twice. I rewrote some of this code to add enable/disable in the replayer fork. The changes should make this easy to fix. I'll track this issue over there. |
I have set up sepia with the below express and proxy server and I am getting two recordings 1 with http and 1 with https. The server is setup as http and proxies to https. Is this something I could fix on the sepia side? Or is this with how the proxy is handling the http requests?
Thanks!
var server = express();
server.set('port', 3000);
var apiProxy = httpProxy.createProxyServer();
var apiForwardingUrl = 'https://commerce-api.example.com';
console.log('Forwarding API requests to ' + apiForwardingUrl);
// commerce api
server.all("/commerce/*", function(req, res) {
apiProxy.web(req, res, {
target: apiForwardingUrl,
agent: https.globalAgent,
headers: {
host: 'commerce-api.example.com'
}
});
});
server.listen(server.get('port'), function() {
console.log(' server'.blue + ' started '.green.bold + 'on port '.blue + server.get('port'));
});
The text was updated successfully, but these errors were encountered: