File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/Nullinside.Api.TwitchBot/Controllers Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -30,18 +30,19 @@ public class TwitchWebHookController : ControllerBase {
30
30
/// <returns></returns>
31
31
[ HttpPost ]
32
32
[ Route ( "chat" ) ]
33
- public async Task < HttpResponseMessage > TwitchChatMessageCallback ( CancellationToken token ) {
33
+ public async Task < ContentResult > TwitchChatMessageCallback ( CancellationToken token ) {
34
34
using StreamReader stream = new StreamReader ( this . HttpContext . Request . Body ) ;
35
35
string stuff = await stream . ReadToEndAsync ( token ) ;
36
36
_log . Info ( $ "TwitchChatMessageCallback: { stuff } ") ;
37
37
38
38
var hi = JsonConvert . DeserializeObject < TwitchChallange > ( stuff ) ;
39
+ var resp = new ContentResult ( ) ;
40
+ resp . ContentType = "text/plain" ;
41
+ resp . StatusCode = ( int ) HttpStatusCode . OK ;
39
42
if ( null != hi ) {
40
- var resp = new HttpResponseMessage ( HttpStatusCode . OK ) ;
41
- resp . Content = new StringContent ( hi . Challenge ? . ToString ( ) ?? string . Empty , System . Text . Encoding . UTF8 , "text/plain" ) ;
42
- return resp ;
43
+ resp . Content = hi . Challenge ? . ToString ( ) ?? string . Empty ;
43
44
}
44
45
45
- return new HttpResponseMessage ( HttpStatusCode . OK ) ;
46
+ return resp ;
46
47
}
47
48
}
You can’t perform that action at this time.
0 commit comments