Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CA735200CAE for ; Wed, 21 Jun 2017 14:51:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C8ADE160BE2; Wed, 21 Jun 2017 12:51:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1B320160BD0 for ; Wed, 21 Jun 2017 14:51:03 +0200 (CEST) Received: (qmail 69245 invoked by uid 500); 21 Jun 2017 12:51:03 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 69234 invoked by uid 99); 21 Jun 2017 12:51:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Jun 2017 12:51:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id BD7691AF9C4 for ; Wed, 21 Jun 2017 12:51:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id B6SlLck3TAO5 for ; Wed, 21 Jun 2017 12:51:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 127EF5F2A8 for ; Wed, 21 Jun 2017 12:51:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 57D5BE099E for ; Wed, 21 Jun 2017 12:51:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1129121940 for ; Wed, 21 Jun 2017 12:51:00 +0000 (UTC) Date: Wed, 21 Jun 2017 12:51:00 +0000 (UTC) From: "Konrad Windszus (JIRA)" To: dev@sling.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (SLING-6976) ContentLoader.binaryFile() and ContentLoader.binaryResource() should try to derive mimetype from classpath resource rather than from target property name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 21 Jun 2017 12:51:05 -0000 [ https://issues.apache.org/jira/browse/SLING-6976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Konrad Windszus updated SLING-6976: ----------------------------------- Attachment: SLING-6976-v01.patch Attached is a proposed patch. [~sseifert@pro-vision.de] Can you have a look? > ContentLoader.binaryFile() and ContentLoader.binaryResource() should try to derive mimetype from classpath resource rather than from target property name > --------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: SLING-6976 > URL: https://issues.apache.org/jira/browse/SLING-6976 > Project: Sling > Issue Type: Bug > Components: Testing > Affects Versions: Testing Sling Mock 2.2.12 > Reporter: Konrad Windszus > Attachments: SLING-6976-v01.patch > > > Currently the {{ContentLoader.binaryFile}} tries to derive the mime type from the target property which should contain the binary (https://github.com/apache/sling/blob/trunk/testing/mocks/sling-mock/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java#L226). This is useless, as the property name almost never contains an extension from which a mimetype could be derived. Instead the first argument (namely {{classpathResource}} should be taken as basis to derive the mime type from). > Currently in practically all cases the mime type will be set to the default value (https://github.com/apache/sling/blob/trunk/testing/mocks/sling-mock/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java#L466) which is {{application/octet-stream}}. -- This message was sent by Atlassian JIRA (v6.4.14#64029)