Make sure you're sending the right header. Try spitting it to STDERR and looking in the erorr log after you make your request. It should be "Application/pdf". If not, you'll need something smarter than File::MimeInfo.
It also could be that your browser is improperly configured to deal with PDFs.