Skip to content

Commit 1d0ac0d

Browse files
Fix missing .well-known files
Workaround `.well-known` files not being copied into the published container image by renaming the folder and manually mapping the requests.
1 parent 93ac0eb commit 1d0ac0d

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎src/Website/Program.cs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,19 @@ static string GetVersion<T>()
185185
=> typeof(T).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion;
186186
});
187187

188+
// HACK Workaround for https://github.com/dotnet/sdk/issues/40511
189+
app.MapGet(".well-known/{fileName}", (string fileName, IWebHostEnvironment environment) =>
190+
{
191+
var file = environment.WebRootFileProvider.GetFileInfo(Path.Combine("well-known", fileName));
192+
193+
if (file.Exists && file.PhysicalPath is { Length: > 0 })
194+
{
195+
return Results.File(file.PhysicalPath, contentType: "application/json");
196+
}
197+
198+
return Results.NotFound();
199+
});
200+
188201
app.UseCookiePolicy(new()
189202
{
190203
HttpOnly = HttpOnlyPolicy.Always,

src/Website/wwwroot/.well-known/apple-app-site-association renamed to src/Website/wwwroot/well-known/apple-app-site-association

File renamed without changes.

src/Website/wwwroot/.well-known/apple-developer-domain-association.txt renamed to src/Website/wwwroot/well-known/apple-developer-domain-association.txt

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)