@microlink/cli 2.1.41 → 2.1.43

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.
Files changed (2) hide show
  1. package/package.json +3 -2
  2. package/src/api.js +2 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@microlink/cli",
3
3
  "description": "Interacting with Microlink API from your terminal.",
4
4
  "homepage": "https://github.com/microlinkhq/cli",
5
- "version": "2.1.41",
5
+ "version": "2.1.43",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
8
  "microlink": "bin/microlink",
@@ -33,6 +33,7 @@
33
33
  "microlink"
34
34
  ],
35
35
  "dependencies": {
36
+ "@kikobeats/content-type": "~1.0.1",
36
37
  "@microlink/mql": "~0.14.0",
37
38
  "clipboardy": "~2.3.0",
38
39
  "is-local-address": "~2.2.0",
@@ -40,7 +41,7 @@
40
41
  "mri": "~1.2.0",
41
42
  "nanospinner": "~1.2.2",
42
43
  "picocolors": "~1.1.1",
43
- "pretty-bytes": "~7.1.0",
44
+ "pretty-bytes": "5",
44
45
  "pretty-ms": "~7.0.1",
45
46
  "restore-cursor": "~3.1.0",
46
47
  "temperment": "~1.0.0",
package/src/api.js CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  require('update-notifier')({ pkg: require('../package.json') }).notify()
6
6
 
7
+ const getContentType = require('@kikobeats/content-type')
7
8
  const { URLSearchParams } = require('url')
8
9
  const clipboardy = require('clipboardy')
9
10
  const mql = require('@microlink/mql')
@@ -61,7 +62,7 @@ const render = ({ response, flags }) => {
61
62
  const { headers, timings, requestUrl: uri, body } = response
62
63
  if (!flags.pretty) return console.log(body.toString())
63
64
 
64
- const contentType = headers['content-type'].split(';')[0].toLowerCase()
65
+ const contentType = getContentType(headers['content-type'])
65
66
  const time = prettyMs(timings.phases.total)
66
67
  const serverTiming = headers['server-timing']
67
68
  const id = headers['x-request-id']