senthor_rails_legacy 0.2.0 → 1.1.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
  SHA256:
3
- metadata.gz: fbbbb985926e92df46b0a0e97096b82bb9764a585d207b43cf07d93a163ab52f
4
- data.tar.gz: c8b9a5c430c06656a56ef664c27bfd491b8653719345c8d9235c78e4add1fe04
3
+ metadata.gz: c6afd4a0504d904f25bcedb1e35ccb0669332f6b9b3aaf4d4c0d7fbda3b0dfab
4
+ data.tar.gz: 653b1bd312052d3ea4816d116b5cec0247d5924d7808c3ffe13d491a1f3d0ac2
5
5
  SHA512:
6
- metadata.gz: fa62bd96695d7e71d900617fbe2925f52a5f12808161da3749ea83aa9c7e0b1f6aa2f8f8fadb19d0a5b44768df1fc1bbd4169b6fdadfb7f5d5c85e46ea6990c6
7
- data.tar.gz: c19152f2d750c014c086d7824f6b77ce516beb71287cde790986448e19d7ddd0ca9596b44e605ede809a56c3e25f66a98cd909a20aaf88b62a1283f72c63bf52
6
+ metadata.gz: 22e5f758e1b84afcb0dbea0ecedb83a4d814c74689c268ca1aa01b3b821f81cf2c1712b9119b1ec984aa3255636822f3632a7e151eed0398fbd349bd72f9ed2c
7
+ data.tar.gz: 6a8b501cbec87cdcead2a415fb3a3e50b9a2dcfe639f9cbfdf20cf075ebc6503dcb559669445b950be5900f88e32a9ae8ac693f551570b0359f013a0518d4e08
@@ -63,16 +63,20 @@ module Senthor
63
63
 
64
64
  response = http.request(request)
65
65
 
66
+ rack_headers = { 'Content-Type' => response['Content-Type'] || 'text/plain' }
67
+ response.each_header do |key, value|
68
+ rack_headers[key] = value if key.downcase.start_with?('crawler-')
69
+ end
70
+
66
71
  # Handle 402 response
67
72
  if response.code.to_i == 402
68
73
  return [
69
74
  402,
70
- { 'Content-Type' => 'text/plain' },
71
- ['This content is protected by a paywall. Visit https://senthor.io to find out how to access the content.']
75
+ rack_headers,
76
+ [response.body]
72
77
  ]
73
78
  end
74
79
 
75
- puts "Continue"
76
80
  # Otherwise continue as normal
77
81
  @app.call(env)
78
82
  end
@@ -1,3 +1,3 @@
1
1
  module SenthorRailsLegacy
2
- VERSION = "0.2.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: senthor_rails_legacy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Senthor