Compare commits
No commits in common. "075342920d3c4c400cf7d2d1c756a61ef3194c5f" and "e6b7ba575f9f5058c39b4291a7e5a3af4c84f031" have entirely different histories.
075342920d
...
e6b7ba575f
@ -338,6 +338,9 @@ controllers.relay = function (req, res, opts) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('POST /api/relay:');
|
||||||
|
console.log(opts.body);
|
||||||
|
console.log();
|
||||||
return urequestAsync(opts.body).then(function (resp) {
|
return urequestAsync(opts.body).then(function (resp) {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
resp = resp.toJSON();
|
resp = resp.toJSON();
|
||||||
|
@ -47,7 +47,7 @@ common.authorize = common.getToken = function getToken(state) {
|
|||||||
state.config.pretoken = pretoken;
|
state.config.pretoken = pretoken;
|
||||||
state._connecting = true;
|
state._connecting = true;
|
||||||
|
|
||||||
return common.reqLocalAsync({ url: '/api/config', method: 'POST', body: state.config }).then(function () {
|
return common.reqLocalAsync({ url: '/api/config', method: 'POST', data: state.config || {} }).then(function () {
|
||||||
console.info("waiting...");
|
console.info("waiting...");
|
||||||
return PromiseA.resolve();
|
return PromiseA.resolve();
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
@ -77,7 +77,7 @@ common.authorize = common.getToken = function getToken(state) {
|
|||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.warn("[warning] could not decode token");
|
console.warn("[warning] could not decode token");
|
||||||
}
|
}
|
||||||
return common.reqLocalAsync({ url: '/api/config', method: 'POST', body: state.config }).then(function () {
|
return common.reqLocalAsync({ url: '/api/config', method: 'POST', data: state.config }).then(function () {
|
||||||
//console.log("Pairing Enabled Locally");
|
//console.log("Pairing Enabled Locally");
|
||||||
return PromiseA.resolve();
|
return PromiseA.resolve();
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
@ -92,7 +92,7 @@ common.authorize = common.getToken = function getToken(state) {
|
|||||||
return PromiseA.resolve();
|
return PromiseA.resolve();
|
||||||
}
|
}
|
||||||
, end: function () {
|
, end: function () {
|
||||||
return common.reqLocalAsync({ url: '/api/enable', method: 'POST', body: [] }).then(function () {
|
return common.reqLocalAsync({ url: '/api/enable', method: 'POST', data: [] }).then(function () {
|
||||||
console.info("Success");
|
console.info("Success");
|
||||||
|
|
||||||
// workaround for https://github.com/nodejs/node/issues/21319
|
// workaround for https://github.com/nodejs/node/issues/21319
|
||||||
|
@ -226,12 +226,9 @@ common.api.token = function (state, handlers) {
|
|||||||
, hostname: pairRequestUrl.hostname
|
, hostname: pairRequestUrl.hostname
|
||||||
, href: pairRequestUrl.href
|
, href: pairRequestUrl.href
|
||||||
, pathname: pairRequestUrl.pathname
|
, pathname: pairRequestUrl.pathname
|
||||||
// because why wouldn't node require 'path' on a json object and accept 'pathname' on a URL object...
|
, port: pairRequestUrl.port
|
||||||
// https://twitter.com/coolaj86/status/1053947919890403328
|
|
||||||
, path: pairRequestUrl.pathname
|
|
||||||
, port: pairRequestUrl.port || null
|
|
||||||
, protocol: pairRequestUrl.protocol
|
, protocol: pairRequestUrl.protocol
|
||||||
, search: pairRequestUrl.search || null
|
, search: pairRequestUrl.search
|
||||||
}
|
}
|
||||||
, method: dir.pair_request.method
|
, method: dir.pair_request.method
|
||||||
, json: authReq
|
, json: authReq
|
||||||
|
Loading…
x
Reference in New Issue
Block a user