So here's what I can get for the code from mochi_web:parse_header:

%% @spec parse_header(string()) -> {Type, [{K, V}]}
%% @doc  Parse a Content-Type like header, return the main Content-Type
%%       and a property list of options.
parse_header(String) ->
    %% TODO: This is exactly as broken as Python's cgi module.
    %%       Should parse properly like mochiweb_cookies.
    [Type | Parts] = [string:strip(S) || S <- string:tokens(String, ";")],
    F = fun (S, Acc) ->
                case lists:splitwith(fun (C) -> C =/= $= end, S) of
                    {"", _} ->
                        %% Skip anything with no name
                        Acc;
                    {_, ""} ->
                        %% Skip anything with no value
                        Acc;
                    {Name, [$\= | Value]} ->
                        [{string:to_lower(string:strip(Name)),
                          unquote_header(string:strip(Value))} | Acc]
                end
        end,
    {string:to_lower(Type),
     lists:foldr(F, [], Parts)}

You might check your headers. They mention Content-Type above -- check your 
colon/semi-colon punctuation.

Hope that helps.


On Jul 26, 2012, at 10:51 PM, idmartin wrote:

> Error running MapReduce operation. Status: 500 : <html><head><title>500
> Internal Server Error</title></head><body>
> Internal Server Error
> The server encountered an error while processing this
> request:<br><pre>{error,function_clause,
>       [{string,tokens1,[undefined,";",[]]},
>        {mochiweb_util,parse_header,1},
>        {riak_kv_wm_mapred,base_type,1},
>        {riak_kv_wm_mapred,ctype_ok,1},
>        {riak_kv_wm_mapred,known_content_type,2},
>        {webmachine_resource,resource_call,3},
>        {webmachine_resource,do,3},
> 
> {webmachine_decision_core,resource_call,1}]}</pre><P><HR><ADDRESS>mochiweb+webmachine
> web server</ADDRESS></body></html>
> 
> 
> 
> 
> --
> View this message in context: 
> http://riak-users.197444.n3.nabble.com/MR-Error-tp4024811.html
> Sent from the Riak Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
  • MR Error idmartin
    • Re: MR Error John Roy

Reply via email to