File tree 2 files changed +12
-2
lines changed 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -238,9 +238,9 @@ public async Task<IActionResult> ResumeJob([FromBody] KeyModel model)
238
238
}
239
239
240
240
[ HttpPost , JsonErrorResponse ]
241
- public IActionResult Cron ( )
241
+ public async Task < IActionResult > Cron ( )
242
242
{
243
- var cron = Request . ReadAsString ( ) ? . Trim ( ) ;
243
+ var cron = ( await Request . ReadAsStringAsync ( ) ) ? . Trim ( ) ;
244
244
if ( string . IsNullOrEmpty ( cron ) )
245
245
return Json ( new { Description = "" , Next = new object [ 0 ] } ) ;
246
246
Original file line number Diff line number Diff line change @@ -82,6 +82,16 @@ public static string ReadAsString(this HttpRequest request)
82
82
83
83
}
84
84
85
+ public static async Task < string > ReadAsStringAsync ( this HttpRequest request )
86
+ {
87
+ using ( var ms = new MemoryStream ( ) )
88
+ {
89
+ await request . Body . CopyToAsync ( ms ) ;
90
+ return Encoding . UTF8 . GetString ( ms . ToArray ( ) ) ;
91
+ }
92
+
93
+ }
94
+
85
95
public static JobDataMap GetQuartzJobDataMap ( this IEnumerable < JobDataMapItemBase > models )
86
96
{
87
97
var map = new JobDataMap ( ) ;
You can’t perform that action at this time.
0 commit comments