From 9892c8d2d9793e4a047a54062d6bd54cbbaaecac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=98=89=E7=A5=A5=20=E8=A9=B9?= Date: Wed, 19 Jun 2024 16:26:20 +0800 Subject: [PATCH] updates --- Program.cs | 19 +++++++++++++++++++ wwwroot/assets/javascript/custom/kollist.js | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) 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"; }