mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
feat: req content-type for upload api
This commit is contained in:
parent
1b109e0dc0
commit
ee8f1914ca
@ -199,10 +199,10 @@ self.parseStripTags = stripTags => {
|
||||
self.upload = async (req, res) => {
|
||||
// Assert Request type
|
||||
// Multipart for regular uploads, JSON for URL uploads
|
||||
const isMultipart = req.is('multipart')
|
||||
const isJson = req.is('json')
|
||||
const isMultipart = req.is('multipart/form-data')
|
||||
const isJson = req.is('application/json')
|
||||
if (!isMultipart && !isJson) {
|
||||
throw new ClientError('Request type must be MULTIPART or JSON.')
|
||||
throw new ClientError('Request Content-Type must be either multipart/form-data or application/json.')
|
||||
}
|
||||
|
||||
let user
|
||||
|
Loading…
Reference in New Issue
Block a user