mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-09 21:09:51 +00:00
Do not attempt to json serialize stream body
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Octokit.Http;
|
||||
using Xunit;
|
||||
using Xunit.Extensions;
|
||||
|
||||
namespace Octokit.Tests.Http
|
||||
{
|
||||
@@ -55,6 +55,18 @@ namespace Octokit.Tests.Http
|
||||
Assert.Equal(json, request.Body);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LeavesStreamBodyAlone()
|
||||
{
|
||||
var stream = new MemoryStream();
|
||||
var request = new Request { Body = stream };
|
||||
var jsonPipeline = new JsonHttpPipeline();
|
||||
|
||||
jsonPipeline.SerializeRequest(request);
|
||||
|
||||
Assert.Same(stream, request.Body);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LeavesNullBodyAlone()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user