aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-06-07 19:07:38 +0200
committerLoïc Hoguin <[email protected]>2013-06-07 19:07:38 +0200
commit830d4c85c8ca764fbd0d419f82facf70fce7761d (patch)
tree7fc188887cc07584c4f7421d5881858ce065195b /src
parenta8737cb763e908dbcd19e2e42bab6afe65e4ba7d (diff)
parentd6c9bb27ad352c1a8da79e5dc6dcf11a71d86a38 (diff)
downloadcowboy-830d4c85c8ca764fbd0d419f82facf70fce7761d.tar.gz
cowboy-830d4c85c8ca764fbd0d419f82facf70fce7761d.tar.bz2
cowboy-830d4c85c8ca764fbd0d419f82facf70fce7761d.zip
Merge branch 'read_with_utc' of git://github.com/narma/cowboy
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_static.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_static.erl b/src/cowboy_static.erl
index fd5654e..d144dd3 100644
--- a/src/cowboy_static.erl
+++ b/src/cowboy_static.erl
@@ -233,7 +233,7 @@ rest_init(Req, Opts) ->
end.
rest_init(Req, Opts, Filepath) ->
- Fileinfo = file:read_file_info(Filepath),
+ Fileinfo = file:read_file_info(Filepath, [{time, universal}]),
Mimetypes = case lists:keyfind(mimetypes, 1, Opts) of
false -> {fun path_to_mimetypes/2, []};
{_, {{M, F}, E}} -> {fun M:F/2, E};
@@ -290,7 +290,7 @@ forbidden(Req, #state{fileinfo={ok, #file_info{access=Access}}}=State) ->
-spec last_modified(Req, #state{})
-> {calendar:datetime(), Req, #state{}} when Req::cowboy_req:req().
last_modified(Req, #state{fileinfo={ok, #file_info{mtime=Modified}}}=State) ->
- {erlang:localtime_to_universaltime(Modified), Req, State}.
+ {Modified, Req, State}.
%% @private Generate the ETag header value for this file.
%% The ETag header value is only generated if the resource is a file that