Skip to content

Commit

Permalink
Merge pull request #153 from ZEXSM/bugfix/send-coverallsreport
Browse files Browse the repository at this point in the history
fix: send coverallsreport bad request 400
  • Loading branch information
lucaslorentz authored Oct 9, 2022
2 parents f9d4737 + 3fbffc4 commit b65a3e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/MiniCover.Reports/Coveralls/CoverallsReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,13 @@ private async Task<int> Post(string json)

using (var client = new HttpClient())
{
using (var formData = new MultipartFormDataContent())
var boundary = Guid.NewGuid().ToString();

using (var formData = new MultipartFormDataContent(boundary))
{
formData.Headers.Remove("Content-Type");
formData.Headers.TryAddWithoutValidation("Content-Type", $"multipart/form-data; boundary={boundary}");

formData.Add(stringContent, "json_file", "coverage.json");

var response = await client.PostAsync(coverallsJobsUrl, formData);
Expand Down

0 comments on commit b65a3e5

Please sign in to comment.