Set necessary headers based on file extension