title: How to determine the Content-Type in an HTTP Response
body: <p>I'm building a web server as an exercise. When I receive a raw request, it gets parsed into an simple syntax tree, and a response is built by evaluating this tree. My question this: <strong><code>When sending an HTTP Response, does the Content-Type field get set by taking the file extension of the requested resource and looking it up in a dictionary of MIME-types?</code></strong> A good example would be the anatomy of how the response for a favicon.ico is built. Any insight into this would be most helpful. Thanks.</p>