web-console 4.0.2 → 4.0.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
  SHA256:
3
- metadata.gz: 38b006503ec43ff88e05efa6c91767852bd16290dc0266a703f6210c5036c029
4
- data.tar.gz: c2aa58c058cfc1593fdeca3f1b98c9f1c2dbc6355f66085c328213e8c14c097a
3
+ metadata.gz: 17cae9167c8b3d4e2047cfaf811a37618feccf0061a79d16d25f79aec051dd58
4
+ data.tar.gz: 97b196f4c170ce48a407cd44a9844d7ee5a7291d34504a73c3356c7b60ede6f2
5
5
  SHA512:
6
- metadata.gz: 847df1cc274ff85315284188931ee700823ce9733f06c5a3d86191037dfcd281131b30a0da3d54fd9bc7b43820ee9fc91a4fca7a86f5e028b8a93c987ca7ec32
7
- data.tar.gz: d183e3efaa71ecbf82672756a23fecbbe00ebe5cb7f9aeb15bce53f2f35a72de6fdf5e236de7a5a459cbbc5ba65b5c85746e85ce160b4a2f237df14c2ef4cbb6
6
+ metadata.gz: d1f7db6881432d184a73388a11750d84b7f14f5d1e0682cec3b916fbc34882b0ed648b381d64c2f552549251fb1281c83786f6960903ea6dc409662c3eec8e1f
7
+ data.tar.gz: 9e1d58172566c9d9d3bdeb7692c4dc2196e26f4572694b37da22da62d1281749a5b8d592a76b8f3d26b813962d65b1b0077ee515c609b0e03b23c1d2e4f0ea03
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 4.0.4
6
+
7
+ * [fb483743](https://github.com/rails/web-console/commit/fb483743a6a2a4168cdc0b2e03f48fc393991b73) Fix a crash on webrick with Rack 2.2.3 ([@gsamokovarov])
8
+
9
+ ## 4.0.3
10
+
11
+ * [#291](https://github.com/rails/web-console/pull/291) Deprecate config.web_console.whitelisted_ips ([@JuanitoFatas])
12
+ * [#290](https://github.com/rails/web-console/pull/290) Fix Content-Length for rack >= 2.1.0 ([@p8])
13
+
5
14
  ## 4.0.2
6
15
 
7
16
  * [#285](https://github.com/rails/web-console/pull/285) Increase timeout on paste ([@celvro])
@@ -12,12 +21,12 @@
12
21
 
13
22
  ## 4.0.0
14
23
 
15
- * [|61c](https://github.com/rails/web-console/commit/61ce65b599f56809de1bd8da6590a80acbd92017) Move to config.web_console.permissions ([@gsamokovarov])
16
- * [|961](https://github.com/rails/web-console/commit/96127aac143e1e653fffdc4bb65e1ce0b5ff342d) Introduce Binding#console as an alternative interface ([@gsamokovarov])
17
- * [|d45](https://github.com/rails/web-console/commit/d4591ca5396ed15a08818f3da11134852a485b27) Introduce Rails 6 support ([@gsamokovarov])
18
- * [|f97](https://github.com/rails/web-console/commit/f97d8a889a38366485e5c5e8985995c19bf61d13) Introduce Ruby 2.6 support ([@gsamokovarov])
19
- * [|d6d](https://github.com/rails/web-console/commit/d6deacd9d5fcaabf3e3051d6985b53f924f86956) Drop Rails 5 support ([@gsamokovarov])
20
- * [|90f](https://github.com/rails/web-console/commit/90fda8789d402f05647c18f8cdf8e5c3d01692dd) Drop Ruby 2.4 support ([@gsamokovarov])
24
+ * [61ce65b5](https://github.com/rails/web-console/commit/61ce65b599f56809de1bd8da6590a80acbd92017) Move to config.web_console.permissions ([@gsamokovarov])
25
+ * [96127ac1](https://github.com/rails/web-console/commit/96127aac143e1e653fffdc4bb65e1ce0b5ff342d) Introduce Binding#console as an alternative interface ([@gsamokovarov])
26
+ * [d4591ca5](https://github.com/rails/web-console/commit/d4591ca5396ed15a08818f3da11134852a485b27) Introduce Rails 6 support ([@gsamokovarov])
27
+ * [f97d8a88](https://github.com/rails/web-console/commit/f97d8a889a38366485e5c5e8985995c19bf61d13) Introduce Ruby 2.6 support ([@gsamokovarov])
28
+ * [d6deacd9](https://github.com/rails/web-console/commit/d6deacd9d5fcaabf3e3051d6985b53f924f86956) Drop Rails 5 support ([@gsamokovarov])
29
+ * [90fda878](https://github.com/rails/web-console/commit/90fda8789d402f05647c18f8cdf8e5c3d01692dd) Drop Ruby 2.4 support ([@gsamokovarov])
21
30
  * [#265](https://github.com/rails/web-console/pull/265) Add support for nested exceptions ([@yuki24])
22
31
 
23
32
  ## 3.7.0
@@ -159,3 +168,5 @@ go to 3.1.0 instead.
159
168
  [@yuki24]: https://github.com/yuki24
160
169
  [@patorash]: https://github.com/patorash
161
170
  [@celvro]: https://github.com/celvro
171
+ [@JuanitoFatas]: https://github.com/JuanitoFatas
172
+ [@p8]: https://github.com/p8
@@ -66,7 +66,7 @@ By default, only requests coming from IPv4 and IPv6 localhosts are allowed.
66
66
  `config.web_console.permissions` lets you control which IP's have access to
67
67
  the console.
68
68
 
69
- You can whitelist single IP's or whole networks. Say you want to share your
69
+ You can allow single IP's or whole networks. Say you want to share your
70
70
  console with `192.168.0.100`:
71
71
 
72
72
  ```ruby
@@ -75,7 +75,7 @@ class Application < Rails::Application
75
75
  end
76
76
  ```
77
77
 
78
- If you want to whitelist the whole private network:
78
+ If you want to allow the whole private network:
79
79
 
80
80
  ```ruby
81
81
  Rails.application.configure do
@@ -13,9 +13,11 @@ module WebConsole
13
13
  end
14
14
 
15
15
  def inject(content)
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")
16
+ # Set Content-Length header to the size of the current body
17
+ # + the extra content. Otherwise the response will be truncated.
18
+ if @headers["Content-Length"]
19
+ @headers["Content-Length"] = (@body.bytesize + content.bytesize).to_s
20
+ end
19
21
 
20
22
  [
21
23
  if position = @body.rindex("</body>")
@@ -4,7 +4,7 @@ require "ipaddr"
4
4
 
5
5
  module WebConsole
6
6
  class Permissions
7
- # IPv4 and IPv6 localhost should be always whitelisted.
7
+ # IPv4 and IPv6 localhost should be always allowed.
8
8
  ALWAYS_PERMITTED_NETWORKS = %w( 127.0.0.0/8 ::1 )
9
9
 
10
10
  def initialize(networks = nil)
@@ -52,10 +52,25 @@ module WebConsole
52
52
  end
53
53
 
54
54
  initializer "web_console.permissions" do
55
- permissions = config.web_console.permissions || config.web_console.whitelisted_ips
55
+ permissions = web_console_permissions
56
56
  Request.permissions = Permissions.new(permissions)
57
57
  end
58
58
 
59
+ def web_console_permissions
60
+ case
61
+ when config.web_console.permissions
62
+ config.web_console.permissions
63
+ when config.web_console.allowed_ips
64
+ config.web_console.allowed_ips
65
+ when config.web_console.whitelisted_ips
66
+ ActiveSupport::Deprecation.warn(<<-MSG.squish)
67
+ The config.web_console.whitelisted_ips is deprecated and will be ignored in future release of web_console.
68
+ Please use config.web_console.allowed_ips instead.
69
+ MSG
70
+ config.web_console.whitelisted_ips
71
+ end
72
+ end
73
+
59
74
  initializer "web_console.whiny_requests" do
60
75
  if config.web_console.key?(:whiny_requests)
61
76
  Middleware.whiny_requests = config.web_console.whiny_requests
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebConsole
4
- VERSION = "4.0.2"
4
+ VERSION = "4.0.4"
5
5
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web-console
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Somerville
8
8
  - Genadi Samokovarov
9
9
  - Guillermo Iguaran
10
10
  - Ryan Dao
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-05-05 00:00:00.000000000 Z
14
+ date: 2020-07-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: railties
@@ -69,7 +69,7 @@ dependencies:
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: 0.4.0
72
- description:
72
+ description:
73
73
  email:
74
74
  - charlie@charliesomerville.com
75
75
  - gsamokovarov@gmail.com
@@ -123,7 +123,7 @@ homepage: https://github.com/rails/web-console
123
123
  licenses:
124
124
  - MIT
125
125
  metadata: {}
126
- post_install_message:
126
+ post_install_message:
127
127
  rdoc_options: []
128
128
  require_paths:
129
129
  - lib
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubygems_version: 3.0.3
142
- signing_key:
142
+ signing_key:
143
143
  specification_version: 4
144
144
  summary: A debugging tool for your Ruby on Rails applications.
145
145
  test_files: []