From d3a6161978c41088d33c3279c5d27c0583dbf662 Mon Sep 17 00:00:00 2001 From: RakVhalate Date: Thu, 1 Dec 2022 22:52:36 +1000 Subject: [PATCH] 123 --- APIControllers/PictureUpload.cs | 2 +- Program.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/APIControllers/PictureUpload.cs b/APIControllers/PictureUpload.cs index 27d221e..1a7eafd 100644 --- a/APIControllers/PictureUpload.cs +++ b/APIControllers/PictureUpload.cs @@ -16,7 +16,7 @@ namespace NeDvachAPI.Controllers var supportedTypes = new[] { "jpg", "png" }; string receivedFileName = PostPicture.FileName; string fileExt = receivedFileName.Substring((receivedFileName.Length) - 3, 3); - if (supportedTypes.Contains(fileExt)) //file type check + if (supportedTypes.Contains(fileExt.ToLower())) //file type check { ///Local Buffer File Part string filePath; diff --git a/Program.cs b/Program.cs index b8b1785..14c57b5 100644 --- a/Program.cs +++ b/Program.cs @@ -11,8 +11,8 @@ builder.Services.AddCors(setup => setup.AddDefaultPolicy(policyBuilder => { - policyBuilder.WithOrigins("http://www.vdk2ch.ru:4200").WithMethods("GET", "POST").WithHeaders("*"); - //policyBuilder.WithOrigins("http://localhost:4200").WithMethods("GET", "POST").WithHeaders("*"); + //policyBuilder.WithOrigins("http://www.vdk2ch.ru:4200").WithMethods("GET", "POST").WithHeaders("*"); + policyBuilder.WithOrigins("http://localhost:4200").WithMethods("GET", "POST").WithHeaders("*"); }); });