Permalink
Browse files

Fix to return 206 status when responding a partial body

  • Loading branch information...
1 parent 46d05f0 commit f88204daa361f886862cdd311dccce7cb57a1182 @mocchira mocchira committed Feb 20, 2014
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/leo_gateway_http_commons.erl
  2. +1 −1 test/leo_gateway_web_tests.erl
@@ -669,7 +669,7 @@ get_range_object(Req, Bucket, Key, {_Unit, Range}) when is_list(Range) ->
Mime = leo_mime:guess_mime(Key),
Header = [?SERVER_HEADER,
{?HTTP_HEAD_RESP_CONTENT_TYPE, Mime}],
- {ok, Req2} = cowboy_req:chunked_reply(?HTTP_ST_OK, Header, Req),
+ {ok, Req2} = cowboy_req:chunked_reply(?HTTP_ST_PARTIAL_CONTENT, Header, Req),
get_range_object_1(Req2, Bucket, Key, Range, undefined).
get_range_object_1(Req,_Bucket,_Key, [], _) ->
@@ -513,7 +513,7 @@ range_object_base([_TermFun, _Node0, Node1], RangeValue) ->
?TARGET_HOST,
":8080/a/b.png"]),
[{"connection", "close"},{"range", RangeValue}]}, [], []),
- ?assertEqual(200, SC),
+ ?assertEqual(206, SC),
?assertEqual("od", Body)
catch
throw:Reason ->

0 comments on commit f88204d

Please sign in to comment.