@metacall/protocol 0.1.23 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/login.js CHANGED
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const axios_1 = __importDefault(require("axios"));
7
+ const url_1 = require("url");
7
8
  exports.default = (email, password, baseURL) => {
8
9
  const request = {
9
10
  email,
@@ -15,7 +16,7 @@ exports.default = (email, password, baseURL) => {
15
16
  .post(baseURL + '/login', request, {
16
17
  headers: {
17
18
  Accept: 'application/json, text/plain, */*',
18
- Host: baseURL.split('//')[1],
19
+ Host: new url_1.URL(baseURL).host,
19
20
  Origin: baseURL
20
21
  }
21
22
  })
package/dist/signup.js CHANGED
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const axios_1 = __importDefault(require("axios"));
7
+ const url_1 = require("url");
7
8
  exports.default = (email, password, alias, baseURL) => {
8
9
  const request = {
9
10
  email,
@@ -16,7 +17,7 @@ exports.default = (email, password, alias, baseURL) => {
16
17
  .post(baseURL + '/signup', request, {
17
18
  headers: {
18
19
  Accept: 'application/json, text/plain, */*',
19
- Host: baseURL.split('//')[1],
20
+ Host: new url_1.URL(baseURL).host,
20
21
  Origin: baseURL
21
22
  }
22
23
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metacall/protocol",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Tool for deploying into MetaCall FaaS platform.",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js",
package/src/login.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import axios from 'axios';
2
+ import { URL } from 'url';
2
3
 
3
4
  interface Request {
4
5
  email: string;
@@ -23,7 +24,7 @@ export default (
23
24
  .post<string>(baseURL + '/login', request, {
24
25
  headers: {
25
26
  Accept: 'application/json, text/plain, */*',
26
- Host: baseURL.split('//')[1],
27
+ Host: new URL(baseURL).host,
27
28
  Origin: baseURL
28
29
  }
29
30
  })
package/src/signup.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import axios from 'axios';
2
+ import { URL } from 'url';
2
3
  interface Request {
3
4
  email: string;
4
5
  password: string;
@@ -23,7 +24,7 @@ export default (
23
24
  .post<string>(baseURL + '/signup', request, {
24
25
  headers: {
25
26
  Accept: 'application/json, text/plain, */*',
26
- Host: baseURL.split('//')[1],
27
+ Host: new URL(baseURL).host,
27
28
  Origin: baseURL
28
29
  }
29
30
  })