checking for octet-stream is definitely not a good idea. `application/zip` or `application/msdownload` are valid binary content types, too. And any content-type (even `text/*`) with a content-disposition of attachment will force most browsers to show a download dialog.

Probably the best way would be to negate the check: A text/* content type without content-disposition header is most certainly not a direct download link.

Just my 2¢