grape_sinatra_helpers 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -112,7 +112,7 @@ module GrapeSinatraHelpers
112
112
  header 'ETag', value
113
113
 
114
114
  if etag_matches? request.env['HTTP_IF_NONE_MATCH'], new_resource
115
- request.safe? ? error!('304 Not Modified', 304) : error!('412 Precondition Failed', 412)
115
+ safe_request? ? error!('304 Not Modified', 304) : error!('412 Precondition Failed', 412)
116
116
  end
117
117
 
118
118
  if request.env['HTTP_IF_MATCH']
@@ -152,6 +152,10 @@ module GrapeSinatraHelpers
152
152
  raise ArgumentError, "unable to convert #{value.inspect} to a Time object"
153
153
  end
154
154
 
155
+ def safe_request?
156
+ request.get? or request.head? or request.options? or request.trace?
157
+ end
158
+
155
159
  end
156
160
  end
157
161
 
@@ -1,3 +1,3 @@
1
1
  module GrapeSinatraHelpers
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape_sinatra_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: