SimpleWorkerRequest 如何将 MIME 类型与扩展关联起来?

发布于 2024-08-27 19:31:55 字数 531 浏览 2 评论 0 原文

我在 卡西尼号,由于 mime 类型未正确发送而出现问题。我最终编写了自己的 Cassini 端口,它根据 mime 类型设置扩展名。

经过一晚良好的睡眠后,我意识到可能存在某种注册表项或配置文件,我可以在其中为 SimpleWorkerRequest,通过 Casinni 提供内容的 .NET 类。不过,我不知道那是什么。

I was serving html referencing svg files in Cassini, and having problems since the mime type was not being sent properly. I ended up writing my own port of Cassini that set the extension based on mime type.

After a good night of sleep I realized that there might be some sort of registry key or config file where I can configure custom mime types for SimpleWorkerRequest, the .NET class that serves content through Casinni. However, I don't know what that is.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半暖夏伤 2024-09-03 19:31:55

我相当确定您必须负责识别并使用 SimpleWorkerRequest.SendKnownResponseHeader

基本的实现和讨论可以在 这篇博文

现在,如果您想重新实现 IIS 的 MIME 类型列表,IIS 会将其自己的列表存储在元数据库(以及后续的 XML)中。 之前的一个 stackoverflow 问题重点介绍了如何访问该列表以及从何处获取该列表。

I'm fairly certain you'll have to be responsible for identifying and then sending the proper MIME types via the response headers using SimpleWorkerRequest.SendKnownResponseHeader.

A basic implementation and discussion of this can be found on this blog post.

Now if you'd like to reimplement IIS' list of MIME types, IIS stores its own list in the metabase (and subsequent XML). A previous stackoverflow question highlights how to access that list and where to pull it from.

高冷爸爸 2024-09-03 19:31:55

如果您不想重新实现,或者只是想复制该列表,Neokernel Web 服务器的默认安装中包含一个 mime 类型列表 (http://www.neokernel.com),并且可以通过更新列表轻松配置服务器以支持不同或自定义的 MIME 类型。

If you don't want to re-implement, or just want to copy the list, there is a list of mime types included with the default installation of the Neokernel Web Server (http://www.neokernel.com) and the server can be easily configured to support different or custom mime types by updating the list.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文