Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const http2 = require('node:http2')
const fp = require('fastify-plugin')
const { LruMap } = require('toad-cache')
const querystring = require('fast-querystring')
const fastContentTypeParse = require('fast-content-type-parse')
const contentTypeParse = require('content-type').parse
const Stream = require('node:stream')
const buildRequest = require('./lib/request')
const {
Expand Down Expand Up @@ -133,7 +133,7 @@ const fastifyReplyFrom = fp(function from (fastify, opts, next) {
// Per RFC 7231 §3.1.1.5 if this header is not present we MAY assume application/octet-stream
let contentType = 'application/octet-stream'
if (req.headers['content-type']) {
const plainContentType = fastContentTypeParse.parse(req.headers['content-type'])
const plainContentType = contentTypeParse(req.headers['content-type'], { parameters: false })
contentType = plainContentType.type
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
},
"dependencies": {
"@fastify/error": "^4.0.0",
"content-type": "^2.0.0",
"end-of-stream": "^1.4.4",
"fast-content-type-parse": "^3.0.0",
"fast-querystring": "^1.1.2",
"fastify-plugin": "^5.0.1",
"toad-cache": "^3.7.0",
Expand All @@ -86,4 +86,4 @@
"publishConfig": {
"access": "public"
}
}
}
Loading