diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/api/api-handler.ts | 2 | ||||
| -rw-r--r-- | src/server/api/common/signin.ts | 2 | ||||
| -rw-r--r-- | src/server/api/private/signin.ts | 2 | ||||
| -rw-r--r-- | src/server/api/private/signup.ts | 4 | ||||
| -rw-r--r-- | src/server/api/service/discord.ts | 4 | ||||
| -rw-r--r-- | src/server/api/service/github.ts | 4 | ||||
| -rw-r--r-- | src/server/api/service/twitter.ts | 4 | ||||
| -rw-r--r-- | src/server/file/send-drive-file.ts | 4 | ||||
| -rw-r--r-- | src/server/proxy/proxy-media.ts | 2 | ||||
| -rw-r--r-- | src/server/web/manifest.ts | 2 | ||||
| -rw-r--r-- | src/server/web/url-preview.ts | 2 |
11 files changed, 16 insertions, 16 deletions
diff --git a/src/server/api/api-handler.ts b/src/server/api/api-handler.ts index a3be1f2aae..b147bca143 100644 --- a/src/server/api/api-handler.ts +++ b/src/server/api/api-handler.ts @@ -5,7 +5,7 @@ import authenticate from './authenticate'; import call from './call'; import { ApiError } from './error'; -export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res) => { +export default (endpoint: IEndpoint, ctx: Koa.Context) => new Promise((res) => { const body = ctx.request.body; const reply = (x?: any, y?: ApiError) => { diff --git a/src/server/api/common/signin.ts b/src/server/api/common/signin.ts index 37229ad1bc..66f89182d2 100644 --- a/src/server/api/common/signin.ts +++ b/src/server/api/common/signin.ts @@ -6,7 +6,7 @@ import { Signins } from '../../../models'; import { genId } from '../../../misc/gen-id'; import { publishMainStream } from '../../../services/stream'; -export default function(ctx: Koa.BaseContext, user: ILocalUser, redirect = false) { +export default function(ctx: Koa.Context, user: ILocalUser, redirect = false) { if (redirect) { //#region Cookie const expires = 1000 * 60 * 60 * 24 * 365; // One Year diff --git a/src/server/api/private/signin.ts b/src/server/api/private/signin.ts index de0e35f500..43928a6b44 100644 --- a/src/server/api/private/signin.ts +++ b/src/server/api/private/signin.ts @@ -10,7 +10,7 @@ import { ensure } from '../../../prelude/ensure'; import { verifyLogin, hash } from '../2fa'; import { randomBytes } from 'crypto'; -export default async (ctx: Koa.BaseContext) => { +export default async (ctx: Koa.Context) => { ctx.set('Access-Control-Allow-Origin', config.url); ctx.set('Access-Control-Allow-Credentials', 'true'); diff --git a/src/server/api/private/signup.ts b/src/server/api/private/signup.ts index d535d49836..63216019e9 100644 --- a/src/server/api/private/signup.ts +++ b/src/server/api/private/signup.ts @@ -15,8 +15,8 @@ import { UserProfile } from '../../../models/entities/user-profile'; import { getConnection } from 'typeorm'; import { UsedUsername } from '../../../models/entities/used-username'; -export default async (ctx: Koa.BaseContext) => { - const body = ctx.request.body as any; +export default async (ctx: Koa.Context) => { + const body = ctx.request.body; const instance = await fetchMeta(true); diff --git a/src/server/api/service/discord.ts b/src/server/api/service/discord.ts index 369061138c..d5ca05577c 100644 --- a/src/server/api/service/discord.ts +++ b/src/server/api/service/discord.ts @@ -12,11 +12,11 @@ import { Users, UserProfiles } from '../../../models'; import { ILocalUser } from '../../../models/entities/user'; import { ensure } from '../../../prelude/ensure'; -function getUserToken(ctx: Koa.BaseContext) { +function getUserToken(ctx: Koa.Context) { return ((ctx.headers['cookie'] || '').match(/i=(\w+)/) || [null, null])[1]; } -function compareOrigin(ctx: Koa.BaseContext) { +function compareOrigin(ctx: Koa.Context) { function normalizeUrl(url: string) { return url ? url.endsWith('/') ? url.substr(0, url.length - 1) : url : ''; } diff --git a/src/server/api/service/github.ts b/src/server/api/service/github.ts index ef5a753a1a..071b4a96d1 100644 --- a/src/server/api/service/github.ts +++ b/src/server/api/service/github.ts @@ -12,11 +12,11 @@ import { Users, UserProfiles } from '../../../models'; import { ILocalUser } from '../../../models/entities/user'; import { ensure } from '../../../prelude/ensure'; -function getUserToken(ctx: Koa.BaseContext) { +function getUserToken(ctx: Koa.Context) { return ((ctx.headers['cookie'] || '').match(/i=(\w+)/) || [null, null])[1]; } -function compareOrigin(ctx: Koa.BaseContext) { +function compareOrigin(ctx: Koa.Context) { function normalizeUrl(url: string) { return url ? url.endsWith('/') ? url.substr(0, url.length - 1) : url : ''; } diff --git a/src/server/api/service/twitter.ts b/src/server/api/service/twitter.ts index cdf674bab0..dc6c593201 100644 --- a/src/server/api/service/twitter.ts +++ b/src/server/api/service/twitter.ts @@ -11,11 +11,11 @@ import { Users, UserProfiles } from '../../../models'; import { ILocalUser } from '../../../models/entities/user'; import { ensure } from '../../../prelude/ensure'; -function getUserToken(ctx: Koa.BaseContext) { +function getUserToken(ctx: Koa.Context) { return ((ctx.headers['cookie'] || '').match(/i=(\w+)/) || [null, null])[1]; } -function compareOrigin(ctx: Koa.BaseContext) { +function compareOrigin(ctx: Koa.Context) { function normalizeUrl(url: string) { return url.endsWith('/') ? url.substr(0, url.length - 1) : url; } diff --git a/src/server/file/send-drive-file.ts b/src/server/file/send-drive-file.ts index 72b2d6073b..e7d0ab291e 100644 --- a/src/server/file/send-drive-file.ts +++ b/src/server/file/send-drive-file.ts @@ -8,12 +8,12 @@ import { InternalStorage } from '../../services/drive/internal-storage'; const assets = `${__dirname}/../../server/file/assets/`; -const commonReadableHandlerGenerator = (ctx: Koa.BaseContext) => (e: Error): void => { +const commonReadableHandlerGenerator = (ctx: Koa.Context) => (e: Error): void => { serverLogger.error(e); ctx.status = 500; }; -export default async function(ctx: Koa.BaseContext) { +export default async function(ctx: Koa.Context) { const key = ctx.params.key; // Fetch drive file diff --git a/src/server/proxy/proxy-media.ts b/src/server/proxy/proxy-media.ts index 415eef6c34..232b7a09cd 100644 --- a/src/server/proxy/proxy-media.ts +++ b/src/server/proxy/proxy-media.ts @@ -6,7 +6,7 @@ import { createTemp } from '../../misc/create-temp'; import { downloadUrl } from '../../misc/donwload-url'; import { detectMine } from '../../misc/detect-mine'; -export async function proxyMedia(ctx: Koa.BaseContext) { +export async function proxyMedia(ctx: Koa.Context) { const url = 'url' in ctx.query ? ctx.query.url : 'https://' + ctx.params.url; // Create temp file diff --git a/src/server/web/manifest.ts b/src/server/web/manifest.ts index 730082da28..36c901d267 100644 --- a/src/server/web/manifest.ts +++ b/src/server/web/manifest.ts @@ -2,7 +2,7 @@ import * as Koa from 'koa'; import * as manifest from '../../client/assets/manifest.json'; import { fetchMeta } from '../../misc/fetch-meta'; -module.exports = async (ctx: Koa.BaseContext) => { +module.exports = async (ctx: Koa.Context) => { const json = JSON.parse(JSON.stringify(manifest)); const instance = await fetchMeta(true); diff --git a/src/server/web/url-preview.ts b/src/server/web/url-preview.ts index 5b2f8759a2..2526ed0f83 100644 --- a/src/server/web/url-preview.ts +++ b/src/server/web/url-preview.ts @@ -8,7 +8,7 @@ import { query } from '../../prelude/url'; const logger = new Logger('url-preview'); -module.exports = async (ctx: Koa.BaseContext) => { +module.exports = async (ctx: Koa.Context) => { const meta = await fetchMeta(); logger.info(meta.summalyProxy |