aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_rest.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-09-16 14:02:07 +0200
committerLoïc Hoguin <[email protected]>2012-09-17 13:57:28 +0200
commit82d7e89ea2e294176a42a46e67fa42df67ae7b21 (patch)
treea3d07a01401278fce9cbd4e29661e5db78a2dd5e /src/cowboy_rest.erl
parentf205d44518800ff669ce8421dcb5f8f04fc6cccb (diff)
downloadcowboy-82d7e89ea2e294176a42a46e67fa42df67ae7b21.tar.gz
cowboy-82d7e89ea2e294176a42a46e67fa42df67ae7b21.tar.bz2
cowboy-82d7e89ea2e294176a42a46e67fa42df67ae7b21.zip
Remove http.hrl dependency in cowboy_rest
Only cowboy_protocol remaining now.
Diffstat (limited to 'src/cowboy_rest.erl')
-rw-r--r--src/cowboy_rest.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl
index 9e5904c..da52ffe 100644
--- a/src/cowboy_rest.erl
+++ b/src/cowboy_rest.erl
@@ -49,8 +49,6 @@
expires :: undefined | no_call | calendar:datetime()
}).
--include("http.hrl").
-
%% @doc Upgrade a HTTP request to the REST protocol.
%%
%% You do not need to call this function manually. To upgrade to the REST
@@ -693,8 +691,9 @@ process_post(Req, State) ->
is_conflict(Req, State) ->
expect(Req, State, is_conflict, false, fun put_resource/2, 409).
-put_resource(Req=#http_req{path=RawPath}, State) ->
- put_resource(cowboy_req:set_meta(put_path, RawPath, Req),
+put_resource(Req, State) ->
+ {Path, Req2} = cowboy_req:path(Req),
+ put_resource(cowboy_req:set_meta(put_path, Path, Req2),
State, fun is_new_resource/2).
%% content_types_accepted should return a list of media types and their