Guess content type from path

Hello, I'm looking to serve data from R2 via workers. I'm used to Rust, and have used https://docs.rs/mime_guess/latest/mime_guess/ in the past to "guess" the mime type for a piece of content based on the path given.

What's the easiest way to do this with workers?
Guessing of MIME types by file extension.
Was this page helpful?