Skip to content
Browse files

Modified cowboy_rest to work appropriately when local time != UTC

  • Loading branch information...
1 parent 09914c4 commit 78394c20026005a0c7f456076a28bdd80d49af33 David Mercer committed Oct 11, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/cowboy_rest.erl
View
10 src/cowboy_rest.erl
@@ -570,9 +570,13 @@ if_modified_since(Req, State, IfModifiedSince) ->
no_call ->
method(Req2, State2);
LastModified ->
- case LastModified > IfModifiedSince of
- true -> method(Req2, State2);
- false -> not_modified(Req2, State2)
+ case calendar:local_time_to_universal_time_dst(LastModified) of
+ [] -> method(Req2, State2);
+ [LastModifiedUtc | _] ->
+ case LastModifiedUtc > IfModifiedSince of
+ true -> method(Req2, State2);
+ false -> not_modified(Req2, State2)
+ end
end
end.

0 comments on commit 78394c2

Please sign in to comment.
Something went wrong with that request. Please try again.