mirror of
https://github.com/BradNut/umami
synced 2025-09-08 17:40:29 +00:00
Fix 500 error in response.
This commit is contained in:
parent
ffb091c1bc
commit
de3bf23e4c
1 changed files with 6 additions and 2 deletions
|
|
@ -7,11 +7,15 @@ export function json(res, data = {}) {
|
|||
}
|
||||
|
||||
export function send(res, data, type = 'text-plain') {
|
||||
return res.status(200).setHeader('Content-Type', type).send(data);
|
||||
res.setHeader('Content-Type', type);
|
||||
|
||||
return res.status(200).send(data);
|
||||
}
|
||||
|
||||
export function redirect(res, url) {
|
||||
return res.status(303).setHeader('Location', url).end();
|
||||
res.setHeader('Location', url);
|
||||
|
||||
return res.status(303).end();
|
||||
}
|
||||
|
||||
export function badRequest(res, msg = '400 Bad Request') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue