Skip to content

Commit

Permalink
Merge pull request mochi#50 from fdmanana/remove_function_clause
Browse files Browse the repository at this point in the history
Removed one mochiweb_request:accepts_content_type/1 function clause
  • Loading branch information
etrepum committed Jul 28, 2011
2 parents 5d59880 + c661601 commit a85a6e2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions src/mochiweb_request.erl
Expand Up @@ -727,8 +727,6 @@ accepted_encodings(SupportedEncodings) ->
%% 5) For an "Accept" header with value "text/*; q=0.0, */*":
%% accepts_content_type("text/plain") -> false
%%
accepts_content_type(ContentType) when is_binary(ContentType) ->
accepts_content_type(binary_to_list(ContentType));
accepts_content_type(ContentType1) ->
ContentType = re:replace(ContentType1, "\\s", "", [global, {return, list}]),
AcceptHeader = case get_header_value("Accept") of
Expand Down
1 change: 1 addition & 0 deletions src/mochiweb_request_tests.erl
Expand Up @@ -7,6 +7,7 @@ accepts_content_type_test() ->
Req1 = mochiweb_request:new(nil, 'GET', "/foo", {1, 1},
mochiweb_headers:make([{"Accept", "multipart/related"}])),
?assertEqual(true, Req1:accepts_content_type("multipart/related")),
?assertEqual(true, Req1:accepts_content_type(<<"multipart/related">>)),

Req2 = mochiweb_request:new(nil, 'GET', "/foo", {1, 1},
mochiweb_headers:make([{"Accept", "text/html"}])),
Expand Down

0 comments on commit a85a6e2

Please sign in to comment.