Skip to content

Commit

Permalink
VCST-121: Pass /api/files requests to the platform (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-dudarev authored Feb 5, 2024
1 parent 16b8b33 commit a6c511f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions VirtoCommerce.Storefront/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,18 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseWhen(
context => context.Request.Path.Value.EndsWith("connect/token"),
appInner => appInner
.RunProxy(context => context.ForwardTo(platformEndpointOptions.Url)
.AddXForwardedHeaders()
.Send()));
.RunProxy(context => context
.ForwardTo(platformEndpointOptions.Url)
.AddXForwardedHeaders()
.Send()));

app.UseWhen(
context => context.Request.Path.StartsWithSegments("/api/files"),
appInner => appInner
.RunProxy(context => context
.ForwardTo(platformEndpointOptions.Url)
.AddXForwardedHeaders()
.Send()));

// It will be good to rewrite endpoint routing as described here, but it's not easy to do:
// https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.1&tabs=visual-studio#routing-startup-code
Expand Down

0 comments on commit a6c511f

Please sign in to comment.