Permalink
Browse files

Merge pull request #50 from fdmanana/remove_function_clause

Removed one mochiweb_request:accepts_content_type/1 function clause
  • Loading branch information...
2 parents 5d59880 + c661601 commit a85a6e28676ef3b77c0b0037c2e45a861935e510 @etrepum etrepum committed Jul 28, 2011
Showing with 1 addition and 2 deletions.
  1. +0 −2 src/mochiweb_request.erl
  2. +1 −0 src/mochiweb_request_tests.erl
@@ -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
@@ -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"}])),

0 comments on commit a85a6e2

Please sign in to comment.