You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2021/06/16 07:01:12 UTC
[thrift] branch master updated: THRIFT-5431 Response should include
'content-type' header Client: netstd Patch: Jens Geyer
This is an automated email from the ASF dual-hosted git repository.
jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git
The following commit(s) were added to refs/heads/master by this push:
new 46693f7 THRIFT-5431 Response should include 'content-type' header Client: netstd Patch: Jens Geyer
46693f7 is described below
commit 46693f7f5ed16370a6f6fa33c48a64fcafbb0f99
Author: Jens Geyer <je...@apache.org>
AuthorDate: Tue Jun 15 23:42:48 2021 +0200
THRIFT-5431 Response should include 'content-type' header
Client: netstd
Patch: Jens Geyer
This closes #2409
---
lib/netstd/Thrift/Transport/Server/THttpServerTransport.cs | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/netstd/Thrift/Transport/Server/THttpServerTransport.cs b/lib/netstd/Thrift/Transport/Server/THttpServerTransport.cs
index a013a9a..05efba2 100644
--- a/lib/netstd/Thrift/Transport/Server/THttpServerTransport.cs
+++ b/lib/netstd/Thrift/Transport/Server/THttpServerTransport.cs
@@ -87,22 +87,23 @@ namespace Thrift.Transport.Server
InputTransportFactory = inputTransFactory;
OutputTransportFactory = outputTransFactory;
+ // never used
+ _ = next;
+ _ = loggerFactory;
/* never used
_next = next;
_logger = (loggerFactory != null) ? loggerFactory.CreateLogger<THttpServerTransport>() : new NullLogger<THttpServerTransport>();
*/
- }
+ }
- public async Task Invoke(HttpContext context)
+ public async Task Invoke(HttpContext context)
{
- context.Response.ContentType = ContentType;
await ProcessRequestAsync(context, context.RequestAborted); //TODO: check for correct logic
}
public async Task ProcessRequestAsync(HttpContext context, CancellationToken cancellationToken)
{
var transport = new TStreamTransport(context.Request.Body, context.Response.Body, Configuration);
-
try
{
var intrans = (InputTransportFactory != null) ? InputTransportFactory.GetTransport(transport) : transport;
@@ -111,6 +112,7 @@ namespace Thrift.Transport.Server
var input = InputProtocolFactory.GetProtocol(intrans);
var output = OutputProtocolFactory.GetProtocol(outtrans);
+ context.Response.ContentType = ContentType;
while (await Processor.ProcessAsync(input, output, cancellationToken))
{
if (!context.Response.HasStarted) // oneway method called