Skip to content

Commit

Permalink
killing mock session with closed browser window
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkoVcode committed May 10, 2017
1 parent 94c12a8 commit 68e2ddd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ins_proxy/src/lib/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Mock.prototype.extractSessionId = function (request) {

Mock.prototype.process = function (data, request, response) {
var mockFound = false;
if(null != data.mockConfig) {
if(null != data.mockConfig && null != data.webSocketsURLs) {
iconsole.log('Mock Resource Found!');
var mockObject = JSON.parse(data.mockConfig);
var requestedMockPath = unpackPath(request);
Expand Down
6 changes: 5 additions & 1 deletion ins_proxy/src/lib/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ Repository.prototype.fetchWSUrls = function () {

Repository.prototype.fetchMockConfig = function (proxySessionId, callback) {
client.get(proxySessionId+'_MOCK', function(err1, mockConfig) {
client.hgetall(proxySessionId+'_WS', function(err2, wsUrls) {
var data = {err1:err1,
mockConfig:mockConfig};
err2:err2,
mockConfig:mockConfig,
webSocketsURLs:wsUrls};
callback(data);
})
});
}

Expand Down

0 comments on commit 68e2ddd

Please sign in to comment.