Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
feat: deprecated onApiRequest
Browse files Browse the repository at this point in the history
普通にhttp(s)でリクエストするべきです。
  • Loading branch information
sousuke0422 committed Apr 26, 2022
1 parent 6070fdd commit 3a026ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server/api/stream/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Users, Followings, Mutings, UserProfiles, ChannelFollowings } from '../
import { publishChannelStream } from '../../../services/stream';
import { UserProfile } from '../../../models/entities/user-profile';
import { Packed } from '@/misc/schema';
import { deprecate } from 'util';

/**
* Main stream connection
Expand Down Expand Up @@ -164,6 +165,7 @@ export default class Connection {
}

/**
* @deprecated
* APIリクエスト要求時
*/
@autobind
Expand All @@ -173,6 +175,8 @@ export default class Connection {

const endpoint = payload.endpoint || payload.ep; // alias

this.sendMessageToWs(`api:${payload.id}`, { msg: "deprecated. use http(s)." })

// 呼び出し
call(endpoint, user, this.app, payload.data).then(res => {
this.sendMessageToWs(`api:${payload.id}`, { res });
Expand Down

0 comments on commit 3a026ce

Please sign in to comment.