mirror of
				https://github.com/nsnail/Ocelot.git
				synced 2025-11-04 15:50:49 +08:00 
			
		
		
		
	Added pre query string middleware function so users can run there own query string logic before ocelot does its mappings
This commit is contained in:
		@@ -34,5 +34,11 @@
 | 
			
		||||
        /// This allows the user to completely override the ocelot authorisation middleware
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public Func<HttpContext, Func<Task>, Task> AuthorisationMiddleware { get; set; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// This allows the user to implement there own query string manipulation logic
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public Func<HttpContext, Func<Task>, Task> PreQueryStringBuilderMiddleware { get; set; }
 | 
			
		||||
        
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -90,6 +90,9 @@ namespace Ocelot.Middleware
 | 
			
		||||
            // Now we can run any header transformation logic
 | 
			
		||||
            builder.UseHttpRequestHeadersBuilderMiddleware();
 | 
			
		||||
 | 
			
		||||
            // Allow the user to implement their own query string manipulation logic
 | 
			
		||||
            builder.UseIfNotNull(middlewareConfiguration.PreQueryStringBuilderMiddleware);
 | 
			
		||||
 | 
			
		||||
            // Now we can run any query string transformation logic
 | 
			
		||||
            builder.UseQueryStringBuilderMiddleware();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user