Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7CF4A9C62 for ; Mon, 5 Mar 2012 17:26:20 +0000 (UTC) Received: (qmail 10998 invoked by uid 500); 5 Mar 2012 17:26:20 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 10972 invoked by uid 500); 5 Mar 2012 17:26:20 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 10963 invoked by uid 99); 5 Mar 2012 17:26:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2012 17:26:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2012 17:26:19 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 371279301 for ; Mon, 5 Mar 2012 17:25:59 +0000 (UTC) Date: Mon, 5 Mar 2012 17:25:59 +0000 (UTC) From: "Phil Barr (Commented) (JIRA)" To: dev@chemistry.apache.org Message-ID: <1590262192.22979.1330968359227.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <443119886.22808.1330965238250.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CMIS-512) DotCMIS returns unexpected document content when connected to SharePoint 2010 via AtomPub MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CMIS-512?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D132224= 59#comment-13222459 ]=20 Phil Barr commented on CMIS-512: -------------------------------- I changed the constructor that takes an HttpWebResponse in HTTP.Response in= http.cs (line 175) to the following to fix this: {code} public Response(HttpWebResponse httpResponse) { this.response =3D httpResponse; StatusCode =3D httpResponse.StatusCode; Message =3D httpResponse.StatusDescription; ContentType =3D httpResponse.ContentType; ContentLength =3D httpResponse.ContentLength =3D=3D -1 ? null : (long?)= httpResponse.ContentLength; string contentTransferEncoding =3D httpResponse.Headers["Content-Transf= er-Encoding"]; bool isBase64 =3D contentTransferEncoding !=3D null && contentTransferE= ncoding.Equals("base64", StringComparison.CurrentCultureIgnoreCase); if (httpResponse.StatusCode =3D=3D HttpStatusCode.OK || httpResponse.StatusCode =3D=3D HttpStatusCode.Created || httpResponse.StatusCode =3D=3D HttpStatusCode.NonAuthoritativeInfor= mation || httpResponse.StatusCode =3D=3D HttpStatusCode.PartialContent) { if (isBase64) { Stream =3D new BufferedStream(new CryptoStream(httpResponse.Get= ResponseStream(), new FromBase64Transform(), CryptoStreamMode.Read )); } else { Stream =3D new BufferedStream(httpResponse.GetResponseStream(),= 64 * 1024); } } else { try { httpResponse.Close(); } catch (Exception) { } } } {code} =20 > DotCMIS returns unexpected document content when connected to SharePoint = 2010 via AtomPub > -------------------------------------------------------------------------= ---------------- > > Key: CMIS-512 > URL: https://issues.apache.org/jira/browse/CMIS-512 > Project: Chemistry > Issue Type: Bug > Components: dotcmis > Affects Versions: DotCMIS 0.3 > Environment: Sharepoint 2010 > Reporter: Phil Barr > Assignee: Florian M=C3=BCller > Labels: sharepoint > > Same as this bug https://issues.apache.org/jira/browse/CMIS-264 but for D= otCMIS. > SharePoint 2010 delivers document content base64 encoded. OpenCMIS doesn'= t honor the Content-Transfer-Encoding HTTP header and passes the encoded st= ream to the application. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira