Skip to content

Commit

Permalink
force plain text header on EventSub verification & root endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
d-fischer committed Jan 31, 2022
1 parent aac1914 commit 1111a1a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/eventsub/src/EventSubBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@ export abstract class EventSubBase extends EventEmitter {
twitchSubscription._status = 'enabled';
}
res.setHeader('Content-Length', verificationBody.challenge.length);
res.setHeader('Content-Type', 'text/plain');
res.writeHead(200, undefined);
res.end(verificationBody.challenge);
this._logger.debug(`Successfully subscribed to event: ${id}`);
Expand Down Expand Up @@ -1073,6 +1074,7 @@ export abstract class EventSubBase extends EventEmitter {

protected _createHandleHealthRequest(): RequestHandler {
return async (req, res) => {
res.setHeader('Content-Type', 'text/plain');
res.end('@twurple/eventsub is listening here');
};
}
Expand Down

0 comments on commit 1111a1a

Please sign in to comment.