From 4786a15034bb8c3fd6b2952a225f98c3b238515e Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 1 Apr 2018 12:33:26 +0900 Subject: [PATCH] Use sendStatus instead of send --- src/server/activitypub.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts index 6cc31de7b..abcee43d3 100644 --- a/src/server/activitypub.ts +++ b/src/server/activitypub.ts @@ -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}`;