Skip to content

Commit 59752d9

Browse files
committed
chore: use @kikobeats/content-type
1 parent c051ead commit 59752d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/api.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
require('update-notifier')({ pkg: require('../package.json') }).notify()
66

7+
const getContentType = require('@kikobeats/content-type')
78
const { URLSearchParams } = require('url')
89
const clipboardy = require('clipboardy')
910
const mql = require('@microlink/mql')
@@ -61,7 +62,7 @@ const render = ({ response, flags }) => {
6162
const { headers, timings, requestUrl: uri, body } = response
6263
if (!flags.pretty) return console.log(body.toString())
6364

64-
const contentType = headers['content-type'].split(';')[0].toLowerCase()
65+
const contentType = getContentType(headers['content-type'])
6566
const time = prettyMs(timings.phases.total)
6667
const serverTiming = headers['server-timing']
6768
const id = headers['x-request-id']

0 commit comments

Comments
 (0)