Comments (4)
@mihaimyh If you don't pass it down then it will use Insecure mode. See the code at https://github.com/thangchung/GrpcJsonTranscoder/blob/master/src/GrpcJsonTranscoder/DownStreamContextExtensions.cs#L62
We work on the new version at https://github.com/vietnam-devs/coolstore-microservices/tree/develop/src/building-blocks/GrpcJsonTranscoder, with more complex scenario can be found at https://github.com/vietnam-devs/coolstore-microservices/blob/develop/src/gateways/webapi-gateway/Program.cs. I will merge the latest version back to this repo soon. Will let you know after this process finish
from grpcjsontranscoder.
The same error for me. (System.IO.IOException: The response ended prematurely.)
When will be available the new working version?
from grpcjsontranscoder.
Try it again. I just deliver the update version on .NET Core 3.1. Feel free to re-open if it's still not working. Thank you
from grpcjsontranscoder.
The same error.
I checked the following:
var configuration = new OcelotPipelineConfiguration
{
PreQueryStringBuilderMiddleware = async (context, next) =>
{
using var channel = GrpcChannel.ForAddress("http://localhost:7001");
var client = new User.UserClient(channel);
var result = await client.GetUserByEmailAsync(new GetUserRequest { Email = "[email protected]" });
var jsonSerializer = new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
var response = new OkResponse<GrpcHttpContent>(new GrpcHttpContent(JsonConvert.SerializeObject(result, jsonSerializer)));
var httpResponseMessage = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = response.Data
};
context.HttpContext.Response.ContentType = "application/json";
context.DownstreamResponse = new DownstreamResponse(httpResponseMessage);
await next.Invoke(); //Causes System.IO.IOException: The response ended prematurely.
}
};
It works when I remove the last line. I do not really know what happens in the pipeline after this...
from grpcjsontranscoder.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpcjsontranscoder.