     Zotero.Server.DataListener.prototype._generateResponse = ((original) ->
       return (status, contentType, body) ->
         response = original.apply(this, arguments)
-        if Zotero.MIME.isTextType(contentType) || !body || !contentType
+        if !contentType || Zotero.MIME.isTextType(contentType) || !body
           return response
         else
           return {contentType: contentType, response: response}

      attachments = item.getAttachments() or []
      attachments = Zotero.Items.get(attachments) if attachments.length != 0
    Zotero.OPDS.log("'#{item.getDisplayTitle(true)}' has #{attachments.length} attachments")
    attachments = (a for a in attachments when a.attachmentMIMEType? != "text/html")
    Zotero.OPDS.log("'#{item.getDisplayTitle(true)}' has #{attachments.length} supported attachments")

    return if attachments.length == 0

    dns.asyncResolve(dns.myHostName, 0, {
      onLookupComplete: (req, rec, status) ->
        address = ''
        return unless rec
        while rec.hasMore()
          ip = rec.getNextAddrAsString()
          address = ip if ip.indexOf(':') < 0
