From 3f55c7abcff15338baf1410b29fdb0248eea23ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=A3=20Rinaldi?= Date: Sun, 26 Mar 2023 22:48:02 -0300 Subject: [PATCH] Fix problems with double slashes --- ImageService/Program.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ImageService/Program.cs b/ImageService/Program.cs index 1d0051d..deb6efb 100644 --- a/ImageService/Program.cs +++ b/ImageService/Program.cs @@ -1,6 +1,7 @@ using System.Globalization; using Microsoft.AspNetCore.HttpLogging; using Microsoft.AspNetCore.Localization; +using Microsoft.AspNetCore.Rewrite; WebApplicationBuilder builder = WebApplication.CreateBuilder(args); builder.Logging.ClearProviders(); @@ -18,6 +19,10 @@ }); WebApplication app = builder.Build(); +var options = new RewriteOptions(); +// Remove double slashes +options.AddRewrite("/*(.*)", "$1", false); +app.UseRewriter(options); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment())