Commits

Anonymous committed d4ac3c6

#33: returnbody doesn't apply the correct Content-Type to the response on raw interface

http://issues.basho.com/show_bug.cgi?id=33

Comments (0)

Files changed (1)

apps/riak/src/raw_http_resource.erl

 content_types_provided(RD, Ctx=#ctx{key=undefined}) ->
     %% bucket-level: JSON description only
     {[{"application/json", produce_bucket_body}], RD, Ctx};
+content_types_provided(RD, Ctx=#ctx{method=Method}=Ctx) when Method =:= 'PUT';
+                                                             Method =:= 'POST' ->
+    {ContentType, _} = extract_content_type(RD),
+    {[{ContentType, produce_doc_body}], RD, Ctx};
 content_types_provided(RD, Ctx0) ->
     DocCtx = ensure_doc(Ctx0),
     case DocCtx#ctx.doc of