varnish_rest_api 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/varnish_rest_api.rb +10 -1
- data/lib/varnish_rest_api/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: 196e88876f375e01591434d86493037a98161f09
|
4
|
+
data.tar.gz: b2cebab2381a4bbc503b2dc34476c99b0d2d2950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9caae0837317e2cd7fd68b4d9340dde898e04e80df1873d3d7c552419a9d21bd186c8d1e9b469c026ef91f2567558617cf9175ae147398b372131318cb61d243
|
7
|
+
data.tar.gz: 5d07c37f8c7253f218b7848095296caeb40b55c317d797f3d810b13f8c1c80eeb68fd6cb3c4ff4d2c870c4895e3abf777f5a2cca1df77630867d259f67f1d752
|
data/lib/varnish_rest_api.rb
CHANGED
@@ -127,7 +127,16 @@ get %r{^/(.*?)/(in|out)$} do
|
|
127
127
|
backend = params[:captures].first
|
128
128
|
action = params[:captures].last
|
129
129
|
health = action == 'out' ? 'sick' : 'auto'
|
130
|
-
|
130
|
+
|
131
|
+
if (!params[:safe].nil?)
|
132
|
+
if (params[:safe] =~ (/^(false|f|no|n|0)$/i))
|
133
|
+
safe = false
|
134
|
+
else
|
135
|
+
safe = true
|
136
|
+
end
|
137
|
+
else
|
138
|
+
safe = true
|
139
|
+
end
|
131
140
|
backends = varnish.set_health(backend,health, safe)
|
132
141
|
|
133
142
|
if backends.empty?
|