Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have some APIs created and they need to be called from known servers. How do I handle CORS in V9 - I couldn't find anything in the documentation (hopefully me just missing it somehow).
Take a look at this thread :)
Thanks Simon. I had in fact seen that post in my Googling and forum search before posting here.
I think that this kind of thing should be more formally part of the V9 documentation. I'll have a check through, and may jump onto the Git repo with that as a suggestion / see if i can add to it.
I have same requirement as you.
Did you manage to get this working? I haven't had any joy so far with implementing.
Thanks to Andy Butland and his blog article Customising the Umbraco Pipeline.
This is how to do it for Cors:
Create a PipelineFilter:
public CorsPipelineFilter() : base(nameof(CorsPipelineFilter))
PostPipeline = app =>
app.UseCors(policy => policy
//app.UseCors(policy => policy.WithOrigins("http://localhost:36261"));
Add filter to Pipeline:
public class ConfigureCorsOptions : IConfigureOptions<UmbracoPipelineOptions>
public void Configure(UmbracoPipelineOptions options)
in Startup in ConfigureServices method:
this made it clear!
Btw. I have just tested it with Umbraco version 11.0.0
But actually this post (https://our.umbraco.com/forum/using-umbraco-and-getting-started/110188-cors-in-umbraco-10-how-to) is an even better solution, because it follows the standard way of doing it and requires less effort.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted