Skip to content

Feature/cors allow all#17

Merged
Krystyna-Szybalska merged 4 commits intodevelopfrom
feature/CorsAllowAll
Dec 7, 2021
Merged

Feature/cors allow all#17
Krystyna-Szybalska merged 4 commits intodevelopfrom
feature/CorsAllowAll

Conversation

@Krystyna-Szybalska
Copy link
Copy Markdown
Member

No description provided.

.AllowAnyMethod()
.AllowAnyHeader());

app.UseMvc();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line


app.UseEndpoints(endpoints => { endpoints.MapControllers(); });

app.UseCors(builder =>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move app.UseCors before app.UseEndpoints

});
services.AddSwaggerGenNewtonsoftSupport();
services.AddCors();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Latest);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this also. We are using AddControllers()

{Title = "WizardWorldApi", Version = GetType().Assembly.GetName().Version.ToString(3)});
});
services.AddSwaggerGenNewtonsoftSupport();
services.AddCors();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move that before addControllers

@Krystyna-Szybalska Krystyna-Szybalska merged commit ad6975a into develop Dec 7, 2021
@Morasiu Morasiu deleted the feature/CorsAllowAll branch December 14, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants