link_thumbnailer 3.2.1 → 3.3.0

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: f99697da11cef790d10eddde8f79ad1dd4a2e1e6
4
- data.tar.gz: c113e7b8c50dda3e4ead33dde327b0beec15435d
3
+ metadata.gz: 62e43acf3460b4ef3da648fa16fb8f3f970d88b8
4
+ data.tar.gz: 4768729820579a8387d692ddba91a3557f548d60
5
5
  SHA512:
6
- metadata.gz: f4f15babf9656fa90eae2cd10c9634011e766f02319e8d80ed03bb47149e30770420c6e17b3d4b91488022b7df4c1ed1cbc2f41b7d5b850f55d514708aed74fa
7
- data.tar.gz: 1572e848bf83ae6eba3bef808474b2ca466b13d8b6ce467c73f0768cd0f57247083400a9a05823cd247a45fe5765438ae242bb2731804c2a6b2e64391896c554
6
+ metadata.gz: 1e4a5a30c0166b19f57a0e2dbc57fda86074ad26caa28fde4ad8c15e1afe278478c4ca27223a155b66ce777765a729e78f5a95ddd080abb535fa5b806eaeafbb
7
+ data.tar.gz: 93464538468ced5cb85119c2e85219f592c33a91733bf1e89741d074253e9a540f949355258a723db38698e712c7c2d079ec6d75539fb249f48cb25109ab772b
@@ -1,3 +1,13 @@
1
+ # 3.3.0
2
+
3
+ - Allows to configure overrided http headers
4
+
5
+ ```ruby
6
+ LinkThumbnailer.configure do |config|
7
+ config.http_override_headers = { 'Accept-Encoding' => 'none', ... }
8
+ end
9
+ ```
10
+
1
11
  # 3.2.1
2
12
 
3
13
  - Fixes #88
@@ -26,7 +26,7 @@ module LinkThumbnailer
26
26
  :verify_ssl, :http_open_timeout, :http_read_timeout, :attributes,
27
27
  :graders, :description_min_length, :positive_regex, :negative_regex,
28
28
  :image_limit, :image_stats, :raise_on_invalid_format, :max_concurrency,
29
- :scrapers
29
+ :scrapers, :http_override_headers
30
30
 
31
31
  alias_method :http_timeout, :http_open_timeout
32
32
  alias_method :http_timeout=, :http_open_timeout=
@@ -62,6 +62,7 @@ module LinkThumbnailer
62
62
  @raise_on_invalid_format = false
63
63
  @max_concurrency = 20
64
64
  @scrapers = [:opengraph, :default]
65
+ @http_override_headers = { 'Accept-Encoding' => 'none' }
65
66
  end
66
67
 
67
68
  end
@@ -39,8 +39,8 @@ module LinkThumbnailer
39
39
 
40
40
  def set_http_headers(headers = {})
41
41
  headers.each { |k, v| http.headers[k] = v }
42
- http.override_headers['User-Agent'] = user_agent
43
- http.override_headers['Accept-Encoding'] = 'none'
42
+ http.override_headers['User-Agent'] = user_agent
43
+ config.http_override_headers.each { |k, v| http.override_headers[k] = v }
44
44
  end
45
45
 
46
46
  def set_http_options
@@ -1,3 +1,3 @@
1
1
  module LinkThumbnailer
2
- VERSION = '3.2.1'
2
+ VERSION = '3.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: link_thumbnailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-Louis Gottfrois
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-16 00:00:00.000000000 Z
11
+ date: 2016-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport