mirror of
https://github.com/kremalicious/umami.git
synced 2025-01-24 17:23:57 +01:00
Fix 500 error in response.
This commit is contained in:
parent
ffb091c1bc
commit
de3bf23e4c
@ -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 New Issue
Block a user