aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_rest.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-09-16 01:55:40 +0200
committerLoïc Hoguin <[email protected]>2012-09-16 03:50:56 +0200
commite13ab806eaadd40c72145b5783c7727f2ed88d14 (patch)
tree83c06e5f4b3c32c9cb971e8145f0555417ce38d3 /src/cowboy_rest.erl
parent527477bd4ac431f3810c3cec6679824112cf3612 (diff)
downloadcowboy-e13ab806eaadd40c72145b5783c7727f2ed88d14.tar.gz
cowboy-e13ab806eaadd40c72145b5783c7727f2ed88d14.tar.bz2
cowboy-e13ab806eaadd40c72145b5783c7727f2ed88d14.zip
Add cowboy_req:delete_resp_header/2
Both requested and better for making Req opaque.
Diffstat (limited to 'src/cowboy_rest.erl')
-rw-r--r--src/cowboy_rest.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl
index a3bcb2e..d2aa127 100644
--- a/src/cowboy_rest.erl
+++ b/src/cowboy_rest.erl
@@ -579,9 +579,8 @@ if_modified_since(Req, State, IfModifiedSince) ->
end
end.
-not_modified(Req=#http_req{resp_headers=RespHeaders}, State) ->
- RespHeaders2 = lists:keydelete(<<"Content-Type">>, 1, RespHeaders),
- Req2 = Req#http_req{resp_headers=RespHeaders2},
+not_modified(Req, State) ->
+ Req2 = cowboy_req:delete_resp_header(<<"Content-Type">>, Req),
{Req3, State2} = set_resp_etag(Req2, State),
{Req4, State3} = set_resp_expires(Req3, State2),
respond(Req4, State3, 304).