diff --git a/Program.cs b/Program.cs index cb4c596..bd6e5aa 100644 --- a/Program.cs +++ b/Program.cs @@ -1,7 +1,26 @@ using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.AspNetCore.ResponseCompression; +using System.IO.Compression; var builder = WebApplication.CreateBuilder(args); +builder.Services.AddResponseCompression(options => +{ + options.EnableForHttps = true; + options.Providers.Add(); + options.Providers.Add(); +}); + +builder.Services.Configure(options => +{ + options.Level = CompressionLevel.Fastest; +}); + +builder.Services.Configure(options => +{ + options.Level = CompressionLevel.SmallestSize; +}); + // Add services to the container. builder.Services.AddControllersWithViews(); builder.Services.TryAddSingleton(); diff --git a/wwwroot/assets/javascript/custom/kollist.js b/wwwroot/assets/javascript/custom/kollist.js index 107fe12..8efa565 100644 --- a/wwwroot/assets/javascript/custom/kollist.js +++ b/wwwroot/assets/javascript/custom/kollist.js @@ -105,7 +105,7 @@ $(document).ready(function () { } - if (kolMedia_url22.indexOf("youtube") >= 0) { + if (kolMedia_url22.indexOf("youtube") < 0) { err_msg += kolMedia_url22 + " 此Youtube網址有誤\n"; }