dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.23k stars 9.95k forks source link

Extensionless files are not served by default #2438

Open aspnet-hello opened 6 years ago

aspnet-hello commented 6 years ago

From @sebastienros on Tuesday, November 14, 2017 6:16:05 PM

Because it's missing an entry in the default IContentTypeProvider Some files like acme-challenge (used by Let's Encrypt) or Apple application ids, don't use extensions.

I'd like to know if it could be reconsidered.

Copied from original issue: aspnet/StaticFiles#223

aspnet-hello commented 6 years ago

From @Tratcher on Tuesday, November 14, 2017 9:38:07 PM

This acme-challenge spec? https://github.com/ietf-wg-acme/acme/blob/0b172d509a725336633b9a76998e907a8e0002e3/draft-ietf-acme-acme.md#L1992 This doesn't look like static content, it looks like a dynamic challenge-response handshake.

Apple app ids look like they're domain name based, or am I missing something? https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/AppID.html

aspnet-hello commented 6 years ago

From @sebastienros on Wednesday, November 15, 2017 9:08:00 AM

This is the set of files I personally needed for Let's Encrypt, you'll notice they don't have extensions

image

Here is the documentation on how to configure Stripe with apple pay id (it's not apple application id, my bad)

image

I believe many developers would lose some time understanding why it doesn't work, or even not be able to update the app that easily as it needs a new deployment.

aspnet-hello commented 6 years ago

From @sebastienros on Wednesday, November 15, 2017 9:42:27 AM

I can confirm that there is no other way to serve these file than setting ServeUnknownFileTypes and optionally DefaultContentType. Registering a custom IContentTypeProvider and adding "" or "." won't have any effect. So it's all or nothing in this case.