mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 15:10:50 +08:00 
			
		
		
		
	Fix incorrect response StatusCode for middleware added before Ocelot (#380)
This commit is contained in:
		
				
					committed by
					
						
						Tom Pallister
					
				
			
			
				
	
			
			
			
						parent
						
							3bde18f6f8
						
					
				
				
					commit
					095406bd45
				
			@@ -60,11 +60,7 @@ namespace Ocelot.Responder
 | 
			
		||||
 | 
			
		||||
        public void SetErrorResponseOnContext(HttpContext context, int statusCode)
 | 
			
		||||
        {
 | 
			
		||||
            context.Response.OnStarting(x =>
 | 
			
		||||
            {
 | 
			
		||||
                context.Response.StatusCode = statusCode;
 | 
			
		||||
                return Task.CompletedTask;
 | 
			
		||||
            }, context);
 | 
			
		||||
            context.Response.StatusCode = statusCode;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private static void AddHeaderIfDoesntExist(HttpContext context, Header httpResponseHeader)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user