web-console 4.0.2 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38b006503ec43ff88e05efa6c91767852bd16290dc0266a703f6210c5036c029
4
- data.tar.gz: c2aa58c058cfc1593fdeca3f1b98c9f1c2dbc6355f66085c328213e8c14c097a
3
+ metadata.gz: 843f71412a6d2c6a31f35062ad86326656caed6a75de13d9e9c3b09d143ccb3c
4
+ data.tar.gz: 6a7a70ff565431ff9f1a2f47db2cfaf9498abf95a030e5ea285c27cf42412dab
5
5
  SHA512:
6
- metadata.gz: 847df1cc274ff85315284188931ee700823ce9733f06c5a3d86191037dfcd281131b30a0da3d54fd9bc7b43820ee9fc91a4fca7a86f5e028b8a93c987ca7ec32
7
- data.tar.gz: d183e3efaa71ecbf82672756a23fecbbe00ebe5cb7f9aeb15bce53f2f35a72de6fdf5e236de7a5a459cbbc5ba65b5c85746e85ce160b4a2f237df14c2ef4cbb6
6
+ metadata.gz: 34e95ab70102f30b04fb9f538a5773b927773be82e9d350374e50d743bbcc02186d66b71506198cde59e169ad0fbaf291ca15e43aeac1b6bb676bf993de668d5
7
+ data.tar.gz: 0b3ad53ed8e1d27d06f11bd9d8f07f197e2a60e902fdba4d7cb1c8014eeac7c3cbc5af2f34b359fb6f60fbd005795cfdcc58185144b8e2ca5a8ca18a767182c6
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 4.0.3
6
+
7
+ * [#291](https://github.com/rails/web-console/pull/291) Deprecate config.web_console.whitelisted_ips ([@JuanitoFatas])
8
+ * [#290](https://github.com/rails/web-console/pull/290) Fix Content-Length for rack >= 2.1.0 ([@p8])
9
+
5
10
  ## 4.0.2
6
11
 
7
12
  * [#285](https://github.com/rails/web-console/pull/285) Increase timeout on paste ([@celvro])
@@ -12,12 +17,12 @@
12
17
 
13
18
  ## 4.0.0
14
19
 
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])
20
+ * [61ce65b5](https://github.com/rails/web-console/commit/61ce65b599f56809de1bd8da6590a80acbd92017) Move to config.web_console.permissions ([@gsamokovarov])
21
+ * [96127ac1](https://github.com/rails/web-console/commit/96127aac143e1e653fffdc4bb65e1ce0b5ff342d) Introduce Binding#console as an alternative interface ([@gsamokovarov])
22
+ * [d4591ca5](https://github.com/rails/web-console/commit/d4591ca5396ed15a08818f3da11134852a485b27) Introduce Rails 6 support ([@gsamokovarov])
23
+ * [f97d8a88](https://github.com/rails/web-console/commit/f97d8a889a38366485e5c5e8985995c19bf61d13) Introduce Ruby 2.6 support ([@gsamokovarov])
24
+ * [d6deacd9](https://github.com/rails/web-console/commit/d6deacd9d5fcaabf3e3051d6985b53f924f86956) Drop Rails 5 support ([@gsamokovarov])
25
+ * [90fda878](https://github.com/rails/web-console/commit/90fda8789d402f05647c18f8cdf8e5c3d01692dd) Drop Ruby 2.4 support ([@gsamokovarov])
21
26
  * [#265](https://github.com/rails/web-console/pull/265) Add support for nested exceptions ([@yuki24])
22
27
 
23
28
  ## 3.7.0
@@ -159,3 +164,5 @@ go to 3.1.0 instead.
159
164
  [@yuki24]: https://github.com/yuki24
160
165
  [@patorash]: https://github.com/patorash
161
166
  [@celvro]: https://github.com/celvro
167
+ [@JuanitoFatas]: https://github.com/JuanitoFatas
168
+ [@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
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.3"
5
5
  end
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: 4.0.2
4
+ version: 4.0.3
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: 2020-05-05 00:00:00.000000000 Z
14
+ date: 2020-06-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: railties