Skip to content

Commit 3eff1ff

Browse files
committed
Fix #249 use proper base url for iframe-based info receiver
1 parent 85cb659 commit 3eff1ff

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/info-iframe.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ if (process.env.NODE_ENV !== 'production') {
1313
debug = require('debug')('sockjs-client:info-iframe');
1414
}
1515

16-
function InfoIframe(url) {
16+
function InfoIframe(baseUrl, url) {
1717
var self = this;
1818
EventEmitter.call(this);
1919

2020
var go = function() {
21-
var ifr = self.ifr = new IframeTransport(InfoReceiverIframe.transportName, url, url);
21+
var ifr = self.ifr = new IframeTransport(InfoReceiverIframe.transportName, url, baseUrl);
2222

2323
ifr.once('message', function(msg) {
2424
if (msg) {

lib/info-receiver.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ inherits(InfoReceiver, EventEmitter);
3030

3131
// TODO this is currently ignoring the list of available transports and the whitelist
3232

33-
InfoReceiver._getReceiver = function(url, urlInfo) {
33+
InfoReceiver._getReceiver = function(baseUrl, url, urlInfo) {
3434
// determine method of CORS support (if needed)
3535
if (urlInfo.sameOrigin) {
3636
return new InfoAjax(url, XHRLocal);
@@ -42,7 +42,7 @@ InfoReceiver._getReceiver = function(url, urlInfo) {
4242
return new InfoAjax(url, XDR);
4343
}
4444
if (InfoIframe.enabled()) {
45-
return new InfoIframe(url);
45+
return new InfoIframe(baseUrl, url);
4646
}
4747
return new InfoAjax(url, XHRFake);
4848
};
@@ -53,7 +53,7 @@ InfoReceiver.prototype.doXhr = function(baseUrl, urlInfo) {
5353
;
5454
debug('doXhr', url);
5555

56-
this.xo = InfoReceiver._getReceiver(url, urlInfo);
56+
this.xo = InfoReceiver._getReceiver(baseUrl, url, urlInfo);
5757

5858
this.timeoutRef = setTimeout(function() {
5959
debug('timeout');

0 commit comments

Comments
 (0)