mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	
				
					committed by
					
						
						Marcelo Castagna
					
				
			
			
				
	
			
			
			
						parent
						
							a9cfc04aa9
						
					
				
				
					commit
					26ae9948d5
				
			@@ -32,6 +32,15 @@ namespace Ocelot.Responder
 | 
			
		||||
                AddHeaderIfDoesntExist(context, httpResponseHeader);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            SetStatusCode(context, (int)response.StatusCode);
 | 
			
		||||
 | 
			
		||||
            context.Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = response.ReasonPhrase;
 | 
			
		||||
 | 
			
		||||
            if (response.Content is null)
 | 
			
		||||
            {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            foreach (var httpResponseHeader in response.Content.Headers)
 | 
			
		||||
            {
 | 
			
		||||
                AddHeaderIfDoesntExist(context, new Header(httpResponseHeader.Key, httpResponseHeader.Value));
 | 
			
		||||
@@ -44,10 +53,6 @@ namespace Ocelot.Responder
 | 
			
		||||
                AddHeaderIfDoesntExist(context, new Header("Content-Length", new []{ response.Content.Headers.ContentLength.ToString() }) );
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            SetStatusCode(context, (int)response.StatusCode);
 | 
			
		||||
 | 
			
		||||
            context.Response.HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = response.ReasonPhrase;
 | 
			
		||||
 | 
			
		||||
            using(content)
 | 
			
		||||
            {
 | 
			
		||||
                if (response.StatusCode != HttpStatusCode.NotModified && context.Response.ContentLength != 0)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user