The excuse for today's post is I need somewhere to write up some findings from an Umbraco support case I've been looking into. A customer was using an external library that provided middleware that needed to be configured between UseRouting() and UseEndpoints() . Which isn't a problem if you have full control over the contents of the StartUp.cs class, but it's not so easy when Umbraco is doing some of this setup for you. Thanks to Benjamin Carleski from the Umbraco community who figured this out and shared it in this forum conversation . Nothing is really different from his answer on setting up CORS, but in this post I can more easily and permanently share the sample code. Assuming we have a library that requires a typical "Add..." addition in the ConfigureServices method and "Use..." in the Configure method of Startup.cs . First we need a pipeline filter class: Then a class responsible for inserting this filter in the pipeline: An...
Senior Developer and head of DXP at Umbraco. Previously with Zone, building solutions primarily on .NET and using Umbraco, EPiServer and Sitecore CMS. This blog is used as a repository for various tips, tricks, issues and impressions drawn from the use of technology my work and interests. All words are my own.