fakeServer request not available in IE9

46 views
Skip to first unread message

David Dripps

unread,
Jul 25, 2012, 1:21:10 PM7/25/12
to sin...@googlegroups.com
Why doesn't IE9 keep a reference to the requests while all other browsers do?  I'm using jasmine with JsTestDriver and this is the console.log of the this.server object in the afterEach teardown function.

In Firefox, Chrome, etc when I create a fake server using sinon.fakeServer.create() and then execute a request I get the following, correct output:

{
    "requests": [{
        "readyState": 4,
        "requestHeaders": {
            "Accept": "application/json, text/javascript, */*; q=0.01"
        },
        "requestBody": null,
... (a bunch of stuff removed for brevity) ...
        "errorFlag": false,
        "responseHeaders": {
            "Content-Type": "application/json"
        }
    }],
    "responses": [{
        "method": "GET",
        "url": "http://localhost:4000/campaigns",
        "response": [200, {
            "Content-Type": "application/json"
        }, "[\"campaignOne\",\"campaignTwo\",\"campaign3\",\"campaign4\"]"]
    }],
    "queue": []
}

In IE9 however, I get the following:

{
    "requests": [],
    "responses": [{
        "method": "GET",
        "url": "http://localhost:4000/campaigns",
        "response": [200, {
            "Content-Type": "application/json"
        }, "[\"campaignOne\",\"campaignTwo\",\"campaign3\",\"campaign4\"]"]
    }]
}

Any thoughts?

Thanks in advance
- David

Christian Johansen

unread,
Aug 8, 2012, 4:15:40 PM8/8/12
to sin...@googlegroups.com
Are you sure there actually are requests being made in IE9?
--
MVH
Christian

David Dripps

unread,
Aug 9, 2012, 3:04:44 AM8/9/12
to sin...@googlegroups.com, chri...@cjohansen.no
Sorry. I should've updated the list when I figured it out.  FF, Chrome, etc don't treat my requests to a different port on localhost as cross-domain, but IE does.  I just proxied the requests through a relative path and that did the trick.  Thanks for the response though.

- David
Reply all
Reply to author
Forward
0 new messages