Permalink
Browse files

Atomize the request method

  • Loading branch information...
1 parent 104bca5 commit 34f1d92a7b366ad4a4163530b716d9c7ae95e119 @evanmiller evanmiller committed with choptastic Mar 18, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/simple_bridge_request_wrapper.erl
View
10 src/simple_bridge_request_wrapper.erl
@@ -13,7 +13,15 @@ set_error(Error1) ->
simple_bridge_request_wrapper:new(Mod, Req, true, PostParams, PostFiles, Error1).
protocol() -> Mod:protocol(Req).
-request_method() -> Mod:request_method(Req).
+request_method() ->
+ case Mod:request_method(Req) of
+ Method when is_binary(Method) ->
+ list_to_atom(binary_to_list(Method));
+ Method when is_list(Method) ->
+ list_to_atom(Method);
+ Method when is_atom(Method) ->
+ Method
+ end.
path() -> Mod:path(Req).
uri() -> Mod:uri(Req).

0 comments on commit 34f1d92

Please sign in to comment.