5.5 MIME Types

► |  | Web Server: HTTP Server

1 | Dispatching Server
2 | Dispatchers
3 | Launching Servers
4 | Web Servers
5 | Internal APIs
6 | Troubleshooting and Tips
| Index

▼ | 5 | Internal APIs

5.1 | Timers
5.2 | Connection Manager
5.3 | Serializable Closures
5.4 | Cache Table
5.5 | MIME Types
5.6 | Serialization Utilities
5.7 | URL Param
5.8 | GZip
5.9 | Miscellaneous Utilities

On this page:

read-mime-types
make-path->mime-type

top contents ← prev up next →

### 5.5 MIME Types🔗ℹ

(require web-server/private/mime-types)
| package: web-server-lib

This module provides function for dealing with "mime.types" files.

> procedure (read-mime-types p) → (hash/c symbol? bytes?)
> p : path-string?

Reads the "mime.types" file from p and constructs a hash table mapping extensions to MIME types.

> procedure (make-path->mime-type p) → (path? . -> . (or/c false/c bytes?))
> p : path-string?

Uses a read-mime-types with p and constructs a function from paths to their MIME type.
top contents ← prev up next →