summary refs log tree commit diff
path: root/extra/admin-api/Spacebar.UApi/Program.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-03-20 18:10:54 +0100
committerRory& <root@rory.gay>2026-03-20 18:10:54 +0100
commit7c73d97576242cab1441d8d97ef7a48fddffb3f5 (patch)
tree80967d9052b78236e704758240b144124f4880da /extra/admin-api/Spacebar.UApi/Program.cs
parentjust one more check (diff)
downloadserver-ts-7c73d97576242cab1441d8d97ef7a48fddffb3f5.tar.xz
some type fixes in UApi
Diffstat (limited to 'extra/admin-api/Spacebar.UApi/Program.cs')
-rw-r--r--extra/admin-api/Spacebar.UApi/Program.cs6
1 files changed, 2 insertions, 4 deletions
diff --git a/extra/admin-api/Spacebar.UApi/Program.cs b/extra/admin-api/Spacebar.UApi/Program.cs

index 3ebc2db5..dd17d291 100644 --- a/extra/admin-api/Spacebar.UApi/Program.cs +++ b/extra/admin-api/Spacebar.UApi/Program.cs
@@ -101,7 +101,7 @@ app.Use((context, next) => { // add some special sauce app.Map("/", async context => { var client = new StreamingHttpClient(); - var cfg = context.RequestServices.GetService<UApiConfiguration>(); + var cfg = context.RequestServices.GetRequiredService<UApiConfiguration>(); var requestMessage = new HttpRequestMessage(new HttpMethod(context.Request.Method), cfg.FallbackApiEndpoint); foreach (var header in context.Request.Headers) @@ -122,11 +122,9 @@ app.Map("/", async context => { await context.Response.Body.WriteAsync(data); }); -// fallback to proxy in case we dont have a specific endpoint... -// TODO config app.MapFallback("{*_}", async context => { var client = new StreamingHttpClient(); - var cfg = context.RequestServices.GetService<UApiConfiguration>(); + var cfg = context.RequestServices.GetRequiredService<UApiConfiguration>(); var requestMessage = new HttpRequestMessage( new HttpMethod(context.Request.Method), cfg.FallbackApiEndpoint + context.Request.Path + context.Request.QueryString