Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed Jul 30, 2024
1 parent d81502d commit d0948f4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Bit.BlazorUI.Demo.Server.Startup;

public class Middlewares
{
public static void Use(WebApplication app, IHostEnvironment env, IConfiguration configuration)
public static void Use(WebApplication app, IWebHostEnvironment env, IConfiguration configuration)
{
app.UseForwardedHeaders();

Expand All @@ -31,7 +31,8 @@ public static void Use(WebApplication app, IHostEnvironment env, IConfiguration
{
app.Use(async (context, next) =>
{
if (context.Request.Query.Any(q => string.Equals(q.Key, "assetVer", StringComparison.InvariantCultureIgnoreCase)))
if (context.Request.Query.Any(q => string.Equals(q.Key, "v", StringComparison.InvariantCultureIgnoreCase)) &&
env.WebRootFileProvider.GetFileInfo(context.Request.Path).Exists)
{
context.Response.OnStarting(async () =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ private static void ConfiureMiddlewares(this WebApplication app)
{
app.Use(async (context, next) =>
{
if (context.Request.Query.Any(q => string.Equals(q.Key, "assetVer", StringComparison.InvariantCultureIgnoreCase)))
if (context.Request.Query.Any(q => string.Equals(q.Key, "v", StringComparison.InvariantCultureIgnoreCase)) &&
env.WebRootFileProvider.GetFileInfo(context.Request.Path).Exists)
{
context.Response.OnStarting(async () =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Bit.Websites.Careers.Server.Startup;

public class Middlewares
{
public static void Use(WebApplication app, IHostEnvironment env, IConfiguration configuration)
public static void Use(WebApplication app, IWebHostEnvironment env, IConfiguration configuration)
{
app.UseForwardedHeaders();

Expand All @@ -32,7 +32,8 @@ public static void Use(WebApplication app, IHostEnvironment env, IConfiguration
{
app.Use(async (context, next) =>
{
if (context.Request.Query.Any(q => string.Equals(q.Key, "assetVer", StringComparison.InvariantCultureIgnoreCase)))
if (context.Request.Query.Any(q => string.Equals(q.Key, "v", StringComparison.InvariantCultureIgnoreCase)) &&
env.WebRootFileProvider.GetFileInfo(context.Request.Path).Exists)
{
context.Response.OnStarting(async () =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Bit.Websites.Platform.Server.Startup;

public class Middlewares
{
public static void Use(WebApplication app, IHostEnvironment env, IConfiguration configuration)
public static void Use(WebApplication app, IWebHostEnvironment env, IConfiguration configuration)
{
app.UseForwardedHeaders();

Expand All @@ -30,7 +30,8 @@ public static void Use(WebApplication app, IHostEnvironment env, IConfiguration
{
app.Use(async (context, next) =>
{
if (context.Request.Query.Any(q => string.Equals(q.Key, "assetVer", StringComparison.InvariantCultureIgnoreCase)))
if (context.Request.Query.Any(q => string.Equals(q.Key, "v", StringComparison.InvariantCultureIgnoreCase)) &&
env.WebRootFileProvider.GetFileInfo(context.Request.Path).Exists)
{
context.Response.OnStarting(async () =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Bit.Websites.Sales.Server.Startup;

public class Middlewares
{
public static void Use(WebApplication app, IHostEnvironment env, IConfiguration configuration)
public static void Use(WebApplication app, IWebHostEnvironment env, IConfiguration configuration)
{
app.UseForwardedHeaders();

Expand All @@ -32,7 +32,8 @@ public static void Use(WebApplication app, IHostEnvironment env, IConfiguration
{
app.Use(async (context, next) =>
{
if (context.Request.Query.Any(q => string.Equals(q.Key, "assetVer", StringComparison.InvariantCultureIgnoreCase)))
if (context.Request.Query.Any(q => string.Equals(q.Key, "v", StringComparison.InvariantCultureIgnoreCase)) &&
env.WebRootFileProvider.GetFileInfo(context.Request.Path).Exists)
{
context.Response.OnStarting(async () =>
{
Expand Down

0 comments on commit d0948f4

Please sign in to comment.