wovnrb 0.1.41 → 0.1.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wovnrb.rb +6 -3
- data/lib/wovnrb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e95bb60cf9db8b7a6f4ecff105c17f6404b4ec03
|
4
|
+
data.tar.gz: 7c5a408ee16e89b91570383d6dc85c599066f48c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cee078d28b14e29014d431a47cbfe25dffa9e7a2a5e6a928ba6e2e9be07ac86137d1b94eb9282005d1e2c9aa703ebc02fddc50fe85fd6729e13db303f9d600b
|
7
|
+
data.tar.gz: c69d1285c4ef3578438509070c9348fbe0ce217b9f62c6185df680d3bf01f57b190224ad9ece030308bd95e8e939aaa2c0705bc4098a9fc02705e56c27e63f22
|
data/lib/wovnrb.rb
CHANGED
@@ -17,7 +17,6 @@ module Wovnrb
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def call(env)
|
20
|
-
Rails.logger.info("IN CALL")
|
21
20
|
unless STORE.valid_settings?
|
22
21
|
return @app.call(env)
|
23
22
|
end
|
@@ -33,21 +32,25 @@ module Wovnrb
|
|
33
32
|
end
|
34
33
|
lang = headers.lang_code
|
35
34
|
|
36
|
-
Rails.logger.info("PASSING FORWARD REQUEST")
|
37
35
|
# pass to application
|
38
36
|
status, res_headers, body = @app.call(headers.request_out)
|
39
|
-
Rails.logger.info("REQUEST RECEIVED")
|
40
37
|
return [status, res_headers, body]
|
41
38
|
|
42
39
|
if res_headers["Content-Type"] =~ /html/ && !body[0].nil?
|
40
|
+
Rails.logger.info("HTML REQUEST")
|
43
41
|
|
44
42
|
values = STORE.get_values(headers.redis_url)
|
43
|
+
Rails.logger.info("VALUES: #{values.count}")
|
45
44
|
url = {
|
46
45
|
:protocol => headers.protocol,
|
47
46
|
:host => headers.host,
|
48
47
|
:pathname => headers.pathname
|
49
48
|
}
|
49
|
+
Rails.logger.info("SWITCH LANG")
|
50
|
+
Rails.logger.info("BODY: #{body}")
|
50
51
|
body = switch_lang(body, values, url, lang, headers) unless status.to_s =~ /^1|302/
|
52
|
+
Rails.logger.info("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SWITCHED~~~~~~~~~~~~~~~~~~~~~~~~~")
|
53
|
+
Rails.logger.info("BODY: #{body}")
|
51
54
|
|
52
55
|
content_length = 0
|
53
56
|
body.each { |b| content_length += b.respond_to?(:bytesize) ? b.bytesize : 0 }
|
data/lib/wovnrb/version.rb
CHANGED