grover 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grover/middleware.rb +12 -5
- data/lib/grover/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bf608ae368489f3130cc1af42bffa5026d9d14c1a7aa1ca1534dbd085fe6c0c
|
4
|
+
data.tar.gz: 8dc8da4dd66e8b08a64514dc6497e5afb1179cd3c657a40597abb29f7573c9fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a508fe62248fd9404e3240128f258d7b5d9d1dbcf3f747181366a50e0025fd4f46f52cade1d70083558b77d3cbb519fe16ed7cb1a00c914f2a014d3ecb3a74a3
|
7
|
+
data.tar.gz: 29799af91ca664634ba205fed874f8f4fb2a19b6930780f68d5a8eae43337b1cefa5c5af5b104c294b026be7e71347b990e873935d9c9a1a34c61eb5f0c335ae
|
data/lib/grover/middleware.rb
CHANGED
@@ -85,7 +85,7 @@ class Grover
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def html_content?(headers)
|
88
|
-
headers['content-type'] =~ %r{text/html|application/xhtml\+xml}
|
88
|
+
headers[lower_case_headers? ? 'content-type' : 'Content-Type'] =~ %r{text/html|application/xhtml\+xml}
|
89
89
|
end
|
90
90
|
|
91
91
|
def update_response(response, headers)
|
@@ -155,11 +155,12 @@ class Grover
|
|
155
155
|
|
156
156
|
def assign_headers(headers, body, content_type)
|
157
157
|
# Do not cache results
|
158
|
-
headers.delete 'etag'
|
159
|
-
headers.delete 'cache-control'
|
158
|
+
headers.delete(lower_case_headers? ? 'etag' : 'ETag')
|
159
|
+
headers.delete(lower_case_headers? ? 'cache-control' : 'Cache-Control')
|
160
160
|
|
161
|
-
headers['content-length'
|
162
|
-
|
161
|
+
headers[lower_case_headers? ? 'content-length' : 'Content-Length'] =
|
162
|
+
(body.respond_to?(:bytesize) ? body.bytesize : body.size).to_s
|
163
|
+
headers[lower_case_headers? ? 'content-type' : 'Content-Type'] = content_type
|
163
164
|
end
|
164
165
|
|
165
166
|
def configure_env_for_grover_request(env)
|
@@ -223,5 +224,11 @@ class Grover
|
|
223
224
|
env.delete 'CONTENT_LENGTH'
|
224
225
|
env.delete 'RAW_POST_DATA'
|
225
226
|
end
|
227
|
+
|
228
|
+
def lower_case_headers?
|
229
|
+
return @lower_case_headers if defined? @lower_case_headers
|
230
|
+
|
231
|
+
@lower_case_headers = Gem::Version.new(Rack.release) >= Gem::Version.new('3')
|
232
|
+
end
|
226
233
|
end
|
227
234
|
end
|
data/lib/grover/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Bromwich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|