secure_headers 2.4.2 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2e4d6f82d6ed89fdcda1354e5ef6f802696bb192
|
|
4
|
+
data.tar.gz: ed1b4550998780641a7c09cdf5d13147ca42c7a6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23c5adf02fd51a402a5daec6f46afb2c84022544f4572f67b65fdf1d9d4b08f3684d67cc9fd3031ec15530f988e1f52f19e63b6d712728c6dd44b366d8246519
|
|
7
|
+
data.tar.gz: ff8f0681465846609d2e1d9962eab1ac98ada78fb837f67a7981bfef549643ec2bdb4985927dabc20ae3f6eb6e79c9ea4a240a37d8ac631b4193870df0c1f268
|
|
@@ -11,6 +11,7 @@ module SecureHeaders
|
|
|
11
11
|
DEFAULT_CSP_HEADER = "default-src https: data: 'unsafe-inline' 'unsafe-eval'; frame-src https: about: javascript:; img-src data:"
|
|
12
12
|
HEADER_NAME = "Content-Security-Policy"
|
|
13
13
|
ENV_KEY = 'secure_headers.content_security_policy'
|
|
14
|
+
USER_AGENT_PARSER = UserAgentParser::Parser.new
|
|
14
15
|
|
|
15
16
|
DIRECTIVES_1_0 = [
|
|
16
17
|
:default_src,
|
|
@@ -304,7 +305,7 @@ module SecureHeaders
|
|
|
304
305
|
end
|
|
305
306
|
|
|
306
307
|
def supported_directives
|
|
307
|
-
@supported_directives ||= case
|
|
308
|
+
@supported_directives ||= case USER_AGENT_PARSER.parse(@ua).family
|
|
308
309
|
when "Chrome"
|
|
309
310
|
CHROME_DIRECTIVES
|
|
310
311
|
when "Safari"
|
|
@@ -317,7 +318,7 @@ module SecureHeaders
|
|
|
317
318
|
end
|
|
318
319
|
|
|
319
320
|
def supports_nonces?
|
|
320
|
-
parsed_ua =
|
|
321
|
+
parsed_ua = USER_AGENT_PARSER.parse(@ua)
|
|
321
322
|
["Chrome", "Opera", "Firefox"].include?(parsed_ua.family)
|
|
322
323
|
end
|
|
323
324
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: secure_headers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.4.
|
|
4
|
+
version: 2.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Neil Matatall
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-10-
|
|
11
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|