mirror of
https://github.com/MisskeyIO/misskey
synced 2024-11-27 22:38:30 +09:00
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 { 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 New Issue
Block a user