web-console 3.6.1 → 3.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +5 -0
- data/lib/web_console/injector.rb +15 -6
- data/lib/web_console/middleware.rb +1 -1
- data/lib/web_console/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f09465d00b163545199aecc34e9f36d967cbfbeede260077e185a535a90c0640
|
4
|
+
data.tar.gz: 84b14845dd1dcce1fcbb644d64a5b3aca5532c8fae0a8b6062d73bce5c5cb7af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f746e8ce11d5da555297a72a3015bbe73d5f5e2133162fbee9da4e42127f3dd8aced4f80f5f1decfd20e14266a999b626a29d94e213fc114b8735dbd66e15de2
|
7
|
+
data.tar.gz: 2060ce124965f5daee3a3f46f3827842bd3efd3996a71a16a82071b0c85b064051619ba69c1f916c7b70d657b29cd94c2e00ce9253ba32da367f98f0bd57e811
|
data/CHANGELOG.markdown
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 3.6.2
|
6
|
+
|
7
|
+
* [#255](https://github.com/rails/web-console/pull/255) Fix the truncated HTML body, because of wrong Content-Length header ([@timomeh])
|
8
|
+
|
5
9
|
## 3.6.1
|
6
10
|
|
7
11
|
* [#252](https://github.com/rails/web-console/pull/252) Fix improper injection in Rack bodies like ActionDispatch::Response::RackBody ([@gsamokovarov])
|
@@ -126,3 +130,4 @@ go to 3.1.0 instead.
|
|
126
130
|
[@pat]: https://github.com/pat
|
127
131
|
[@ybart]: https://github.com/ybart
|
128
132
|
[@fl0l0u]: https://github.com/fl0l0u
|
133
|
+
[@timomeh]: https://github.com/timomeh
|
data/lib/web_console/injector.rb
CHANGED
@@ -3,19 +3,28 @@
|
|
3
3
|
module WebConsole
|
4
4
|
# Injects content into a Rack body.
|
5
5
|
class Injector
|
6
|
-
def initialize(body)
|
6
|
+
def initialize(body, headers)
|
7
7
|
@body = "".dup
|
8
8
|
|
9
9
|
body.each { |part| @body << part }
|
10
10
|
body.close if body.respond_to?(:close)
|
11
|
+
|
12
|
+
@headers = headers
|
11
13
|
end
|
12
14
|
|
13
15
|
def inject(content)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
# Remove any previously set Content-Length header because we modify
|
17
|
+
# the body. Otherwise the response will be truncated.
|
18
|
+
@headers.delete("Content-Length")
|
19
|
+
|
20
|
+
[
|
21
|
+
if position = @body.rindex("</body>")
|
22
|
+
[ @body.insert(position, content) ]
|
23
|
+
else
|
24
|
+
[ @body << content ]
|
25
|
+
end,
|
26
|
+
@headers
|
27
|
+
]
|
19
28
|
end
|
20
29
|
end
|
21
30
|
end
|
@@ -34,7 +34,7 @@ module WebConsole
|
|
34
34
|
headers["X-Web-Console-Mount-Point"] = mount_point
|
35
35
|
|
36
36
|
template = Template.new(env, session)
|
37
|
-
body = Injector.new(body).inject(template.render("index"))
|
37
|
+
body, headers = Injector.new(body, headers).inject(template.render("index"))
|
38
38
|
end
|
39
39
|
|
40
40
|
[ status, headers, body ]
|
data/lib/web_console/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charlie Somerville
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2018-04-
|
14
|
+
date: 2018-04-29 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: railties
|