Use sendStatus instead of send
This commit is contained in:
parent
55f716fc62
commit
63c3c3dfdd
@ -1,8 +1,9 @@
|
|||||||
|
import * as express from 'express';
|
||||||
|
|
||||||
import config from '../conf';
|
import config from '../conf';
|
||||||
import { extractPublic } from '../crypto_key';
|
import { extractPublic } from '../crypto_key';
|
||||||
import parseAcct from '../common/user/parse-acct';
|
import parseAcct from '../common/user/parse-acct';
|
||||||
import User, { ILocalAccount } from '../models/user';
|
import User, { ILocalAccount } from '../models/user';
|
||||||
const express = require('express');
|
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ app.get('/@:user', async (req, res, next) => {
|
|||||||
|
|
||||||
const { username, host } = parseAcct(req.params.user);
|
const { username, host } = parseAcct(req.params.user);
|
||||||
if (host !== null) {
|
if (host !== null) {
|
||||||
return res.send(422);
|
return res.sendStatus(422);
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = await User.findOne({
|
const user = await User.findOne({
|
||||||
@ -22,7 +23,7 @@ app.get('/@:user', async (req, res, next) => {
|
|||||||
host: null
|
host: null
|
||||||
});
|
});
|
||||||
if (user === null) {
|
if (user === null) {
|
||||||
return res.send(404);
|
return res.sendStatus(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
const id = `${config.url}/@${user.username}`;
|
const id = `${config.url}/@${user.username}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user