[
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.