Skip to content

Commit 6083426

Browse files
committed
Synchronize the error messages in DetectBoundary and DetectBoundaryAsync
1 parent 7c8033d commit 6083426

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Source/HttpMultipartParser/StreamingBinaryMultipartFormDataParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ private static string DetectBoundary(RebufferableBinaryReader reader)
257257
var line = reader.ReadLine();
258258

259259
// The line must not be empty and must starts with "--".
260-
if (string.IsNullOrEmpty(line)) throw new MultipartParseException("Unable to determine boundary: unexpected end of stream");
260+
if (string.IsNullOrEmpty(line)) throw new MultipartParseException("Unable to determine boundary: either the stream is empty or we reached the end of the stream");
261261
else if (!line.StartsWith("--")) throw new MultipartParseException("Unable to determine boundary: content does not start with a valid multipart boundary");
262262

263263
// Remove the two dashes
@@ -300,7 +300,7 @@ private static async Task<string> DetectBoundaryAsync(RebufferableBinaryReader r
300300

301301
// The line must not be empty and must starts with "--".
302302
if (string.IsNullOrEmpty(line)) throw new MultipartParseException("Unable to determine boundary: either the stream is empty or we reached the end of the stream");
303-
else if (!line.StartsWith("--")) throw new MultipartParseException("Unable to determine boundary: content is not a valid multipart boundary");
303+
else if (!line.StartsWith("--")) throw new MultipartParseException("Unable to determine boundary: content does not start with a valid multipart boundary");
304304

305305
// Remove the two dashes
306306
string boundary = line.Substring(2);

0 commit comments

Comments
 (0)