mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-20 03:38:15 +08:00
fixed a bug where getting invalid parameter error if sending a steam content with no stream, now we try convert to byte array which the c# http client is happy to take if empty...or this error is caused because we are trying to use a stream when we shouldnt.
This commit is contained in:
@ -69,7 +69,7 @@ namespace Ocelot.UnitTests.RequestBuilder
|
||||
_request = new OkResponse<Request>(request);
|
||||
_requestBuilder
|
||||
.Setup(x => x.Build(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<Stream>(), It.IsAny<IHeaderDictionary>(),
|
||||
It.IsAny<IRequestCookieCollection>(), It.IsAny<string>(), It.IsAny<string>()))
|
||||
It.IsAny<IRequestCookieCollection>(), It.IsAny<QueryString>(), It.IsAny<string>()))
|
||||
.ReturnsAsync(_request);
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace Ocelot.UnitTests.RequestBuilder
|
||||
private HttpContent _content;
|
||||
private IHeaderDictionary _headers;
|
||||
private IRequestCookieCollection _cookies;
|
||||
private string _query;
|
||||
private QueryString _query;
|
||||
private string _contentType;
|
||||
private readonly IRequestBuilder _requestBuilder;
|
||||
private Response<Request> _result;
|
||||
@ -137,7 +137,7 @@ namespace Ocelot.UnitTests.RequestBuilder
|
||||
{
|
||||
this.Given(x => x.GivenIHaveHttpMethod("POST"))
|
||||
.And(x => x.GivenIHaveDownstreamUrl("http://www.bbc.co.uk"))
|
||||
.And(x => x.GivenTheQueryStringIs("?jeff=1&geoff=2"))
|
||||
.And(x => x.GivenTheQueryStringIs(new QueryString("?jeff=1&geoff=2")))
|
||||
.When(x => x.WhenICreateARequest())
|
||||
.And(x => x.ThenTheCorrectQueryStringIsUsed("?jeff=1&geoff=2"))
|
||||
.BDDfy();
|
||||
@ -153,7 +153,7 @@ namespace Ocelot.UnitTests.RequestBuilder
|
||||
_result.Data.HttpRequestMessage.RequestUri.Query.ShouldBe(expected);
|
||||
}
|
||||
|
||||
private void GivenTheQueryStringIs(string query)
|
||||
private void GivenTheQueryStringIs(QueryString query)
|
||||
{
|
||||
_query = query;
|
||||
}
|
||||
|
Reference in New Issue
Block a user