Update newSingle.ts

This commit is contained in:
Khushraj Rathod 2020-10-31 00:30:57 +05:30 committed by GitHub
parent 35cdee72a1
commit 3103294d0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,7 @@ export default async (req: ServerRequest) => {
const decoder = new TextDecoder()
const buf = await Deno.readAll(req.body)
const singleFileURL = JSON.parse(decoder.decode(buf))
const singleFileURL = decoder.decode(buf)
if (typeof singleFileURL != 'string') {
return req.respond({ status: 422, body: JSON.stringify({ error: 'newSingle only accepts a single URL' }) })
}