diff --git a/lib/mock.js b/lib/mock.js index 5cfb3cf..30d03a8 100644 --- a/lib/mock.js +++ b/lib/mock.js @@ -443,14 +443,27 @@ function MockHttpServer (handler) { }; MockHttpServer.prototype = { + getProperties: function () { + var xhr = new XMLHttpRequest(); + return { + withCredentials: xhr.withCredentials + } + }, + start: function () { var self = this; + var props = this.getProperties(); + function Request () { this.onsend = function () { self.handle(this); }; MockHttpRequest.apply(this, arguments); + + for(var i in props) { + this[i] = props[i]; + } } Request.prototype = MockHttpRequest.prototype;