Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 25149 invoked from network); 17 Nov 2009 07:18:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Nov 2009 07:18:05 -0000 Received: (qmail 42002 invoked by uid 500); 17 Nov 2009 07:18:04 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 41888 invoked by uid 500); 17 Nov 2009 07:18:03 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 41876 invoked by uid 99); 17 Nov 2009 07:18:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2009 07:18:03 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2009 07:17:59 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A1745234C045 for ; Mon, 16 Nov 2009 23:17:39 -0800 (PST) Message-ID: <1338047972.1258442259647.JavaMail.jira@brutus> Date: Tue, 17 Nov 2009 07:17:39 +0000 (UTC) From: "Filipe Manana (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-558) Validate Content-MD5 request headers on uploads In-Reply-To: <82731282.1257191699494.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778746#action_12778746 ] Filipe Manana commented on COUCHDB-558: --------------------------------------- I even prefer: %% @spec to_mochiweb_headers(binary()) -> headers() %% %% Transforms the given binary, which represents a full raw %% HTTP header (ending with double CRLF) into a mochiweb headers %% structure. %% to_mochiweb_headers(RawHttpHeader) -> to_mochiweb_headers(RawHttpHeader, []). to_mochiweb_headers(RawHttpHeader, Acc) -> { ok, {http_header, _, H, _, V}, Rest } = erlang:decode_packet(httph, RawHttpHeader, []), case Rest of <<"\r\n">> -> mochiweb_headers:make([{H, V} | Acc]); R -> to_mochiweb_headers(R, [{H, V} | Acc]) end. This way we just pass an entire raw header, e.g. to_mochiweb_headers( ?l2b( [TrailerFromMochiweb, "\r\n"] ) ). In this case, it should go to mochiweb_header.erl or mochiweb_util.erl. Everything seems more clear now. Does couchdb has custom code in the mochiweb lib found in its source repository? Or it's just the plain, standard mochiweb lib duplicated from googlecode? > Validate Content-MD5 request headers on uploads > ----------------------------------------------- > > Key: COUCHDB-558 > URL: https://issues.apache.org/jira/browse/COUCHDB-558 > Project: CouchDB > Issue Type: Improvement > Components: Database Core, HTTP Interface > Reporter: Adam Kocoloski > Fix For: 0.11 > > Attachments: jira-couchdb-558-for-trunk-2nd-try.patch, jira-couchdb-558-for-trunk-3rd-try.patch, jira-couchdb-558-for-trunk.patch, run.tpl.patch > > > We could detect in-flight data corruption if a client sends a Content-MD5 header along with the data and Couch validates the MD5 on arrival. > RFC1864 - The Content-MD5 Header Field > http://www.faqs.org/rfcs/rfc1864.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.