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 +4 -4
- data/lib/senthor_rails_legacy/middleware.rb +7 -3
- data/lib/senthor_rails_legacy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c6afd4a0504d904f25bcedb1e35ccb0669332f6b9b3aaf4d4c0d7fbda3b0dfab
|
|
4
|
+
data.tar.gz: 653b1bd312052d3ea4816d116b5cec0247d5924d7808c3ffe13d491a1f3d0ac2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
71
|
-
[
|
|
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
|