headers_cleaner 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/headers_cleaner/rack.rb +6 -0
- data/lib/headers_cleaner/version.rb +2 -2
- 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: 4f775df6e53993dfd918e2ba5d79c7b9fb573698
|
4
|
+
data.tar.gz: 5ed3a349a89f1d98759b099c36d0f731951602e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2f2d4c25a0589395e34fb8b58117157aa8d019814d6f7ea785acf5300cc28342be0deb49f2b4ffb22e6817c76bb4f2707acaf4b7b60f9e803eb8bcac926514d
|
7
|
+
data.tar.gz: 7d415a6636422bd1559b625eea7184ba6a6b77479b5afff7bc9d09e05650688fbe67a777fdf2916e5e14fd4f2f975ec81d401030ca4bacaa3cb1dffdcb5839ed
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@ Or install it yourself as:
|
|
28
28
|
|
29
29
|
# you can passe remove params for remove specific header
|
30
30
|
# by default Server X-Runtime and X-Powered-By headers is removed
|
31
|
-
config.middleware.insert_before(0,
|
31
|
+
config.middleware.insert_before(0, HeadersCleaner.middleware)
|
32
32
|
```
|
33
33
|
|
34
34
|
## Development
|
data/lib/headers_cleaner/rack.rb
CHANGED
@@ -12,6 +12,12 @@ module HeadersCleaner
|
|
12
12
|
def call(env)
|
13
13
|
status, headers, body = @app.call(env)
|
14
14
|
@to_remove_headers.each { |key| headers.delete(key) }
|
15
|
+
|
16
|
+
# Define fake server
|
17
|
+
# because some server (e.g. thin reset server)
|
18
|
+
# https://github.com/macournoyer/thin/commit/617fccf7f7e1ee93671e8905623852e23fcc296c
|
19
|
+
headers['Server'] = '42'
|
20
|
+
|
15
21
|
[status, headers, body]
|
16
22
|
end
|
17
23
|
|