mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-15 05:05:42 +01:00
Use sendStatus instead of send
This commit is contained in:
parent
55f716fc62
commit
63c3c3dfdd
1 changed files with 4 additions and 3 deletions
|
@ -1,8 +1,9 @@
|
|||
import * as express from 'express';
|
||||
|
||||
import config from '../conf';
|
||||
import { extractPublic } from '../crypto_key';
|
||||
import parseAcct from '../common/user/parse-acct';
|
||||
import User, { ILocalAccount } from '../models/user';
|
||||
const express = require('express');
|
||||
|
||||
const app = express();
|
||||
|
||||
|
@ -14,7 +15,7 @@ app.get('/@:user', async (req, res, next) => {
|
|||
|
||||
const { username, host } = parseAcct(req.params.user);
|
||||
if (host !== null) {
|
||||
return res.send(422);
|
||||
return res.sendStatus(422);
|
||||
}
|
||||
|
||||
const user = await User.findOne({
|
||||
|
@ -22,7 +23,7 @@ app.get('/@:user', async (req, res, next) => {
|
|||
host: null
|
||||
});
|
||||
if (user === null) {
|
||||
return res.send(404);
|
||||
return res.sendStatus(404);
|
||||
}
|
||||
|
||||
const id = `${config.url}/@${user.username}`;
|
||||
|
|
Loading…
Reference in a new issue