Skip to content

Commit

Permalink
fix http helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
om26er committed Sep 17, 2020
1 parent 5a83c5e commit d145bf1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/autobahn/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ let http_post = function (url, data, timeout) {

log.debug("new http_post request", url, data, timeout);

let d = deferred_factory();
let factory = deferred_factory();
let d = factory();
let req = new XMLHttpRequest();
req.withCredentials = true; // pass along cookies
req.onreadystatechange = function () {
Expand Down Expand Up @@ -199,7 +200,8 @@ let http_post = function (url, data, timeout) {
// Helper to do HTTP/GET requests returning JSON parsed result as a promise.
let http_get_json = function (url, timeout) {

let d = deferred_factory();
let factory = deferred_factory();
let d = factory();
let req = new XMLHttpRequest();
req.withCredentials = true; // pass along cookies
req.onreadystatechange = function () {
Expand Down

0 comments on commit d145bf1

Please sign in to comment.