admin_it 1.2.3 → 1.2.4

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: 6ec3eb78a87d91d7b2dba8f2c4113960ae39b73e
4
- data.tar.gz: f4f6e92081571574f4b8a919747a7fe98369a603
3
+ metadata.gz: 5ea45ae12dfa39a5eb46b774a61d8741b98b872d
4
+ data.tar.gz: 5972652948f50c990f2615ef7fc404f83778f6bd
5
5
  SHA512:
6
- metadata.gz: 19616ee61e99a9291bd57b5f581687eefc43b8ff560614c3b9a3de1d013ba1fc1891f3d5d89655d60ede36e14df612b752aba6574703c3282dc1e8a130c7cbf8
7
- data.tar.gz: 3238518aff17e67ddc0d1c65220ec89d23ce943149428680c1a10e5ce5c7851d6c5a107167fa638d6d27b5bfb9086f7a0ed413a0654e453767eebadc321a383b
6
+ metadata.gz: d4f8cca2ab698cfe6e8a88ced8993407f2ff4ddde7a4c1c269a76d0aee53a0711ae581a06a27010387ac71c79e1c24821bbebaa0654d6a8ebac3d313b9adf6b8
7
+ data.tar.gz: c5c0034fafd30b62402ac69b96b6fa2b5c618d5908942408c35f10b2f7470a9b3cf953d5bbd3e97f6b26a7eed31ede9c2abae2ab0eb9f4c07691046cafd38e2d
data/README.md CHANGED
@@ -36,6 +36,12 @@ bundle install
36
36
 
37
37
  # Changes
38
38
 
39
+ `1.2.4`
40
+ * fixed: Content-Length in production environment
41
+
42
+ `1.2.3`
43
+ * minor fixes
44
+
39
45
  `1.2.2`
40
46
  * added: select2 fields
41
47
 
@@ -169,7 +169,6 @@ module AdminIt
169
169
  @fields.find { |f| f.name == name }
170
170
  end
171
171
 
172
-
173
172
  def save(**params)
174
173
  return if controller.nil?
175
174
  session = controller.session
@@ -33,7 +33,7 @@ module AdminIt
33
33
 
34
34
  # AdminIt middleware
35
35
  class Middleware
36
- SUBST_REGEXP = /<!--\s*([a-zA-Z0-9_]+)\s*-->/
36
+ SUBST_REGEXP = /<!--\s*(?<name>[a-zA-Z0-9_]+)\s*-->/
37
37
 
38
38
  def initialize(app)
39
39
  @app = app
@@ -43,10 +43,12 @@ module AdminIt
43
43
  request = env[Request::ENV_KEY] = Request.new(env)
44
44
  status, headers, body = @app.call(env)
45
45
  if request.process?
46
+ length = 0
46
47
  body.each do |str|
47
- # $1 not working here ???
48
48
  str.gsub!(SUBST_REGEXP) { |s| request[SUBST_REGEXP.match(s)[1]] }
49
+ length += str.size
49
50
  end
51
+ headers['Content-Length'] = length.to_s
50
52
  end
51
53
  [status, headers, body]
52
54
  end
@@ -1,5 +1,5 @@
1
1
  #
2
2
  module AdminIt
3
3
  # Current gem version
4
- VERSION = '1.2.3'
4
+ VERSION = '1.2.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admin_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Ovchinnikov