logstash-output-amazon_es 2.0.1-java → 6.4.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CONTRIBUTORS +12 -0
- data/Gemfile +8 -0
- data/LICENSE +10 -199
- data/README.md +34 -65
- data/lib/logstash/outputs/amazon_es.rb +218 -423
- data/lib/logstash/outputs/amazon_es/common.rb +347 -0
- data/lib/logstash/outputs/amazon_es/common_configs.rb +141 -0
- data/lib/logstash/outputs/amazon_es/elasticsearch-template-es2x.json +95 -0
- data/lib/logstash/outputs/amazon_es/elasticsearch-template-es5x.json +46 -0
- data/lib/logstash/outputs/amazon_es/elasticsearch-template-es6x.json +45 -0
- data/lib/logstash/outputs/amazon_es/elasticsearch-template-es7x.json +46 -0
- data/lib/logstash/outputs/amazon_es/http_client.rb +359 -74
- data/lib/logstash/outputs/amazon_es/http_client/manticore_adapter.rb +169 -0
- data/lib/logstash/outputs/amazon_es/http_client/pool.rb +457 -0
- data/lib/logstash/outputs/amazon_es/http_client_builder.rb +164 -0
- data/lib/logstash/outputs/amazon_es/template_manager.rb +36 -0
- data/logstash-output-amazon_es.gemspec +13 -22
- data/spec/es_spec_helper.rb +37 -0
- data/spec/unit/http_client_builder_spec.rb +189 -0
- data/spec/unit/outputs/elasticsearch/http_client/manticore_adapter_spec.rb +105 -0
- data/spec/unit/outputs/elasticsearch/http_client/pool_spec.rb +198 -0
- data/spec/unit/outputs/elasticsearch/http_client_spec.rb +222 -0
- data/spec/unit/outputs/elasticsearch/template_manager_spec.rb +25 -0
- data/spec/unit/outputs/elasticsearch_spec.rb +615 -0
- data/spec/unit/outputs/error_whitelist_spec.rb +60 -0
- metadata +49 -110
- data/lib/logstash/outputs/amazon_es/aws_transport.rb +0 -109
- data/lib/logstash/outputs/amazon_es/aws_v4_signer.rb +0 -7
- data/lib/logstash/outputs/amazon_es/aws_v4_signer_impl.rb +0 -62
- data/lib/logstash/outputs/amazon_es/elasticsearch-template.json +0 -41
- data/spec/amazon_es_spec_helper.rb +0 -69
- data/spec/unit/outputs/amazon_es_spec.rb +0 -50
- data/spec/unit/outputs/elasticsearch/protocol_spec.rb +0 -36
- data/spec/unit/outputs/elasticsearch_proxy_spec.rb +0 -58
@@ -0,0 +1,60 @@
|
|
1
|
+
require "logstash/outputs/amazon_es"
|
2
|
+
require_relative "../../../spec/es_spec_helper"
|
3
|
+
|
4
|
+
describe "whitelisting error types in expected behavior" do
|
5
|
+
let(:template) { '{"template" : "not important, will be updated by :index"}' }
|
6
|
+
let(:event1) { LogStash::Event.new("somevalue" => 100, "@timestamp" => "2014-11-17T20:37:17.223Z") }
|
7
|
+
let(:action1) { ["index", {:_id=>1, :_routing=>nil, :_index=>"logstash-2014.11.17", :_type=>"doc"}, event1] }
|
8
|
+
let(:settings) { {"manage_template" => true,
|
9
|
+
"index" => "logstash-2014.11.17",
|
10
|
+
"template_overwrite" => true,
|
11
|
+
"hosts" => get_host_port(),
|
12
|
+
"protocol" => "http",
|
13
|
+
"port" => 9200,
|
14
|
+
"aws_access_key_id" => "AAAAAAAAAAAAAAAAAAAA",
|
15
|
+
"aws_secret_access_key" => "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"} }
|
16
|
+
|
17
|
+
subject { LogStash::Outputs::ElasticSearch.new(settings) }
|
18
|
+
|
19
|
+
before :each do
|
20
|
+
allow(subject.logger).to receive(:warn)
|
21
|
+
|
22
|
+
subject.register
|
23
|
+
|
24
|
+
allow(subject.client).to receive(:maximum_seen_major_version).and_return(0)
|
25
|
+
allow(subject.client).to receive(:bulk).and_return(
|
26
|
+
{
|
27
|
+
"errors" => true,
|
28
|
+
"items" => [{
|
29
|
+
"create" => {
|
30
|
+
"status" => 409,
|
31
|
+
"error" => {
|
32
|
+
"type" => "document_already_exists_exception",
|
33
|
+
"reason" => "[shard] document already exists"
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}]
|
37
|
+
})
|
38
|
+
|
39
|
+
subject.multi_receive([event1])
|
40
|
+
end
|
41
|
+
|
42
|
+
after :each do
|
43
|
+
subject.close
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "when failure logging is enabled for everything" do
|
47
|
+
it "should log a failure on the action" do
|
48
|
+
expect(subject.logger).to have_received(:warn).with("Failed action.", anything)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe "when failure logging is disabled for docuemnt exists error" do
|
53
|
+
let(:settings) { super.merge("failure_type_logging_whitelist" => ["document_already_exists_exception"]) }
|
54
|
+
|
55
|
+
it "should log a failure on the action" do
|
56
|
+
expect(subject.logger).not_to have_received(:warn).with("Failed action.", anything)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
metadata
CHANGED
@@ -1,49 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-amazon_es
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.4.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Amazon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
19
|
-
name: concurrent-ruby
|
20
|
-
prerelease: false
|
21
|
-
type: :runtime
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
29
|
-
requirements:
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 1.0.10
|
18
|
+
version: 0.5.4
|
33
19
|
- - "<"
|
34
20
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
36
|
-
name:
|
21
|
+
version: 1.0.0
|
22
|
+
name: manticore
|
37
23
|
prerelease: false
|
38
24
|
type: :runtime
|
39
25
|
version_requirements: !ruby/object:Gem::Requirement
|
40
26
|
requirements:
|
41
27
|
- - ">="
|
42
28
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
29
|
+
version: 0.5.4
|
44
30
|
- - "<"
|
45
31
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
32
|
+
version: 1.0.0
|
47
33
|
- !ruby/object:Gem::Dependency
|
48
34
|
requirement: !ruby/object:Gem::Requirement
|
49
35
|
requirements:
|
@@ -123,117 +109,55 @@ dependencies:
|
|
123
109
|
requirements:
|
124
110
|
- - "~>"
|
125
111
|
- !ruby/object:Gem::Version
|
126
|
-
version: 0
|
127
|
-
name:
|
128
|
-
prerelease: false
|
129
|
-
type: :runtime
|
130
|
-
version_requirements: !ruby/object:Gem::Requirement
|
131
|
-
requirements:
|
132
|
-
- - "~>"
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
version: 0.9.1
|
135
|
-
- !ruby/object:Gem::Dependency
|
136
|
-
requirement: !ruby/object:Gem::Requirement
|
137
|
-
requirements:
|
138
|
-
- - "~>"
|
139
|
-
- !ruby/object:Gem::Version
|
140
|
-
version: 0.10.0
|
141
|
-
name: faraday_middleware
|
142
|
-
prerelease: false
|
143
|
-
type: :runtime
|
144
|
-
version_requirements: !ruby/object:Gem::Requirement
|
145
|
-
requirements:
|
146
|
-
- - "~>"
|
147
|
-
- !ruby/object:Gem::Version
|
148
|
-
version: 0.10.0
|
149
|
-
- !ruby/object:Gem::Dependency
|
150
|
-
requirement: !ruby/object:Gem::Requirement
|
151
|
-
requirements:
|
152
|
-
- - "<"
|
153
|
-
- !ruby/object:Gem::Version
|
154
|
-
version: 2.5.0
|
155
|
-
name: addressable
|
156
|
-
prerelease: false
|
157
|
-
type: :development
|
158
|
-
version_requirements: !ruby/object:Gem::Requirement
|
159
|
-
requirements:
|
160
|
-
- - "<"
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
version: 2.5.0
|
163
|
-
- !ruby/object:Gem::Dependency
|
164
|
-
requirement: !ruby/object:Gem::Requirement
|
165
|
-
requirements:
|
166
|
-
- - "~>"
|
167
|
-
- !ruby/object:Gem::Version
|
168
|
-
version: 0.0.42
|
169
|
-
name: ftw
|
112
|
+
version: '0'
|
113
|
+
name: logstash-codec-plain
|
170
114
|
prerelease: false
|
171
115
|
type: :development
|
172
116
|
version_requirements: !ruby/object:Gem::Requirement
|
173
117
|
requirements:
|
174
118
|
- - "~>"
|
175
119
|
- !ruby/object:Gem::Version
|
176
|
-
version: 0
|
120
|
+
version: '0'
|
177
121
|
- !ruby/object:Gem::Dependency
|
178
122
|
requirement: !ruby/object:Gem::Requirement
|
179
123
|
requirements:
|
180
|
-
- - "
|
124
|
+
- - "~>"
|
181
125
|
- !ruby/object:Gem::Version
|
182
126
|
version: '0'
|
183
|
-
name: logstash-
|
127
|
+
name: logstash-devutils
|
184
128
|
prerelease: false
|
185
129
|
type: :development
|
186
130
|
version_requirements: !ruby/object:Gem::Requirement
|
187
131
|
requirements:
|
188
|
-
- - "
|
132
|
+
- - "~>"
|
189
133
|
- !ruby/object:Gem::Version
|
190
134
|
version: '0'
|
191
135
|
- !ruby/object:Gem::Dependency
|
192
136
|
requirement: !ruby/object:Gem::Requirement
|
193
137
|
requirements:
|
194
|
-
- - "
|
195
|
-
- !ruby/object:Gem::Version
|
196
|
-
version: 0.5.2
|
197
|
-
- - "<"
|
198
|
-
- !ruby/object:Gem::Version
|
199
|
-
version: 1.0.0
|
200
|
-
name: manticore
|
201
|
-
prerelease: false
|
202
|
-
type: :runtime
|
203
|
-
version_requirements: !ruby/object:Gem::Requirement
|
204
|
-
requirements:
|
205
|
-
- - ">="
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
version: 0.5.2
|
208
|
-
- - "<"
|
209
|
-
- !ruby/object:Gem::Version
|
210
|
-
version: 1.0.0
|
211
|
-
- !ruby/object:Gem::Dependency
|
212
|
-
requirement: !ruby/object:Gem::Requirement
|
213
|
-
requirements:
|
214
|
-
- - ">="
|
138
|
+
- - "~>"
|
215
139
|
- !ruby/object:Gem::Version
|
216
140
|
version: '0'
|
217
|
-
name:
|
141
|
+
name: flores
|
218
142
|
prerelease: false
|
219
143
|
type: :development
|
220
144
|
version_requirements: !ruby/object:Gem::Requirement
|
221
145
|
requirements:
|
222
|
-
- - "
|
146
|
+
- - "~>"
|
223
147
|
- !ruby/object:Gem::Version
|
224
148
|
version: '0'
|
225
149
|
- !ruby/object:Gem::Dependency
|
226
150
|
requirement: !ruby/object:Gem::Requirement
|
227
151
|
requirements:
|
228
|
-
- - "
|
152
|
+
- - "~>"
|
229
153
|
- !ruby/object:Gem::Version
|
230
154
|
version: '0'
|
231
|
-
name:
|
155
|
+
name: elasticsearch
|
232
156
|
prerelease: false
|
233
157
|
type: :development
|
234
158
|
version_requirements: !ruby/object:Gem::Requirement
|
235
159
|
requirements:
|
236
|
-
- - "
|
160
|
+
- - "~>"
|
237
161
|
- !ruby/object:Gem::Version
|
238
162
|
version: '0'
|
239
163
|
description: Output events to Amazon Elasticsearch Service with V4 signing
|
@@ -242,24 +166,35 @@ executables: []
|
|
242
166
|
extensions: []
|
243
167
|
extra_rdoc_files: []
|
244
168
|
files:
|
169
|
+
- CONTRIBUTORS
|
245
170
|
- Gemfile
|
246
171
|
- LICENSE
|
247
172
|
- NOTICE.TXT
|
248
173
|
- README.md
|
249
174
|
- lib/logstash/outputs/amazon_es.rb
|
250
|
-
- lib/logstash/outputs/amazon_es/
|
251
|
-
- lib/logstash/outputs/amazon_es/
|
252
|
-
- lib/logstash/outputs/amazon_es/
|
253
|
-
- lib/logstash/outputs/amazon_es/elasticsearch-template.json
|
175
|
+
- lib/logstash/outputs/amazon_es/common.rb
|
176
|
+
- lib/logstash/outputs/amazon_es/common_configs.rb
|
177
|
+
- lib/logstash/outputs/amazon_es/elasticsearch-template-es2x.json
|
178
|
+
- lib/logstash/outputs/amazon_es/elasticsearch-template-es5x.json
|
179
|
+
- lib/logstash/outputs/amazon_es/elasticsearch-template-es6x.json
|
180
|
+
- lib/logstash/outputs/amazon_es/elasticsearch-template-es7x.json
|
254
181
|
- lib/logstash/outputs/amazon_es/http_client.rb
|
182
|
+
- lib/logstash/outputs/amazon_es/http_client/manticore_adapter.rb
|
183
|
+
- lib/logstash/outputs/amazon_es/http_client/pool.rb
|
184
|
+
- lib/logstash/outputs/amazon_es/http_client_builder.rb
|
185
|
+
- lib/logstash/outputs/amazon_es/template_manager.rb
|
255
186
|
- logstash-output-amazon_es.gemspec
|
256
|
-
- spec/
|
257
|
-
- spec/unit/
|
258
|
-
- spec/unit/outputs/elasticsearch/
|
259
|
-
- spec/unit/outputs/
|
260
|
-
|
187
|
+
- spec/es_spec_helper.rb
|
188
|
+
- spec/unit/http_client_builder_spec.rb
|
189
|
+
- spec/unit/outputs/elasticsearch/http_client/manticore_adapter_spec.rb
|
190
|
+
- spec/unit/outputs/elasticsearch/http_client/pool_spec.rb
|
191
|
+
- spec/unit/outputs/elasticsearch/http_client_spec.rb
|
192
|
+
- spec/unit/outputs/elasticsearch/template_manager_spec.rb
|
193
|
+
- spec/unit/outputs/elasticsearch_spec.rb
|
194
|
+
- spec/unit/outputs/error_whitelist_spec.rb
|
195
|
+
homepage: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/index.html
|
261
196
|
licenses:
|
262
|
-
-
|
197
|
+
- Apache-2.0
|
263
198
|
metadata:
|
264
199
|
logstash_plugin: 'true'
|
265
200
|
logstash_group: output
|
@@ -279,12 +214,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
214
|
version: '0'
|
280
215
|
requirements: []
|
281
216
|
rubyforge_project:
|
282
|
-
rubygems_version: 2.6.
|
217
|
+
rubygems_version: 2.6.13
|
283
218
|
signing_key:
|
284
219
|
specification_version: 4
|
285
220
|
summary: Logstash Output to Amazon Elasticsearch Service
|
286
221
|
test_files:
|
287
|
-
- spec/
|
288
|
-
- spec/unit/
|
289
|
-
- spec/unit/outputs/elasticsearch/
|
290
|
-
- spec/unit/outputs/
|
222
|
+
- spec/es_spec_helper.rb
|
223
|
+
- spec/unit/http_client_builder_spec.rb
|
224
|
+
- spec/unit/outputs/elasticsearch/http_client/manticore_adapter_spec.rb
|
225
|
+
- spec/unit/outputs/elasticsearch/http_client/pool_spec.rb
|
226
|
+
- spec/unit/outputs/elasticsearch/http_client_spec.rb
|
227
|
+
- spec/unit/outputs/elasticsearch/template_manager_spec.rb
|
228
|
+
- spec/unit/outputs/elasticsearch_spec.rb
|
229
|
+
- spec/unit/outputs/error_whitelist_spec.rb
|
@@ -1,109 +0,0 @@
|
|
1
|
-
require 'faraday'
|
2
|
-
require 'faraday_middleware'
|
3
|
-
require 'aws-sdk-core'
|
4
|
-
require 'elasticsearch'
|
5
|
-
require 'elasticsearch-transport'
|
6
|
-
require 'manticore'
|
7
|
-
require 'faraday/adapter/manticore'
|
8
|
-
|
9
|
-
#
|
10
|
-
require 'uri'
|
11
|
-
|
12
|
-
require_relative "aws_v4_signer"
|
13
|
-
|
14
|
-
|
15
|
-
module Elasticsearch
|
16
|
-
module Transport
|
17
|
-
module Transport
|
18
|
-
module HTTP
|
19
|
-
|
20
|
-
# Transport implementation, which V4 Signs requests using the [_Faraday_](https://rubygems.org/gems/faraday)
|
21
|
-
# library for abstracting the HTTP client.
|
22
|
-
#
|
23
|
-
# @see Transport::Base
|
24
|
-
#
|
25
|
-
class AWS
|
26
|
-
include Elasticsearch::Transport::Transport::Base
|
27
|
-
|
28
|
-
|
29
|
-
DEFAULT_PORT = 80
|
30
|
-
DEFAULT_PROTOCOL = "http"
|
31
|
-
|
32
|
-
CredentialConfig = Struct.new(
|
33
|
-
:access_key_id,
|
34
|
-
:secret_access_key,
|
35
|
-
:session_token,
|
36
|
-
:profile,
|
37
|
-
:instance_profile_credentials_retries,
|
38
|
-
:instance_profile_credentials_timeout,
|
39
|
-
:region
|
40
|
-
)
|
41
|
-
|
42
|
-
# Performs the request by invoking {Transport::Base#perform_request} with a block.
|
43
|
-
#
|
44
|
-
# @return [Response]
|
45
|
-
# @see Transport::Base#perform_request
|
46
|
-
#
|
47
|
-
def perform_request(method, path, params={}, body=nil)
|
48
|
-
super do |connection, url|
|
49
|
-
response = connection.connection.run_request \
|
50
|
-
method.downcase.to_sym,
|
51
|
-
url,
|
52
|
-
( body ? __convert_to_json(body) : nil ),
|
53
|
-
{}
|
54
|
-
|
55
|
-
Response.new response.status, response.body, response.headers
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
# Builds and returns a collection of connections.
|
60
|
-
#
|
61
|
-
# @return [Connections::Collection]
|
62
|
-
#
|
63
|
-
def __build_connections
|
64
|
-
region = options[:region]
|
65
|
-
access_key_id = options[:aws_access_key_id] || nil
|
66
|
-
secret_access_key = options[:aws_secret_access_key] || nil
|
67
|
-
session_token = options[:session_token] || nil
|
68
|
-
profile = options[:profile] || 'default'
|
69
|
-
instance_cred_retries = options[:instance_profile_credentials_retries] || 0
|
70
|
-
instance_cred_timeout = options[:instance_profile_credentials_timeout] || 1
|
71
|
-
|
72
|
-
credential_config = CredentialConfig.new(access_key_id, secret_access_key, session_token, profile,
|
73
|
-
instance_cred_retries, instance_cred_timeout, region)
|
74
|
-
credentials = Aws::CredentialProviderChain.new(credential_config).resolve
|
75
|
-
|
76
|
-
Connections::Collection.new \
|
77
|
-
:connections => hosts.map { |host|
|
78
|
-
host[:protocol] = host[:scheme] || DEFAULT_PROTOCOL
|
79
|
-
host[:port] ||= DEFAULT_PORT
|
80
|
-
url = __full_url(host)
|
81
|
-
|
82
|
-
aes_connection = ::Faraday::Connection.new(url, (options[:transport_options] || {})) do |faraday|
|
83
|
-
faraday.request :aws_v4_signer,
|
84
|
-
credentials: credentials,
|
85
|
-
service_name: 'es',
|
86
|
-
region: region
|
87
|
-
faraday.adapter :manticore
|
88
|
-
end
|
89
|
-
|
90
|
-
Connections::Connection.new \
|
91
|
-
:host => host,
|
92
|
-
:connection => aes_connection
|
93
|
-
},
|
94
|
-
:selector_class => options[:selector_class],
|
95
|
-
:selector => options[:selector]
|
96
|
-
end
|
97
|
-
|
98
|
-
# Returns an array of implementation specific connection errors.
|
99
|
-
#
|
100
|
-
# @return [Array]
|
101
|
-
#
|
102
|
-
def host_unreachable_exceptions
|
103
|
-
[::Faraday::Error::ConnectionFailed, ::Faraday::Error::TimeoutError]
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
require 'aws-sdk-core'
|
2
|
-
require 'faraday'
|
3
|
-
|
4
|
-
|
5
|
-
class AwsV4Signer < Faraday::Middleware
|
6
|
-
class Request
|
7
|
-
def initialize(env)
|
8
|
-
@env = env
|
9
|
-
end
|
10
|
-
|
11
|
-
def headers
|
12
|
-
@env.request_headers
|
13
|
-
end
|
14
|
-
|
15
|
-
def set_header(header)
|
16
|
-
@env.request_headers = header
|
17
|
-
end
|
18
|
-
|
19
|
-
def body
|
20
|
-
@env.body || ''
|
21
|
-
end
|
22
|
-
|
23
|
-
def endpoint
|
24
|
-
@env.url
|
25
|
-
end
|
26
|
-
|
27
|
-
def http_method
|
28
|
-
@env.method.to_s.upcase
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def signer
|
33
|
-
credentials = @options.fetch(:credentials)
|
34
|
-
service_name = @options.fetch(:service_name)
|
35
|
-
region = @options.fetch(:region)
|
36
|
-
Aws::Signers::V4.new(credentials, service_name, region)
|
37
|
-
end
|
38
|
-
|
39
|
-
def initialize(app, options = nil)
|
40
|
-
super(app)
|
41
|
-
@options = options
|
42
|
-
@net_http = app.is_a?(Faraday::Adapter::NetHttp)
|
43
|
-
end
|
44
|
-
|
45
|
-
def call(env)
|
46
|
-
normalize_for_net_http!(env)
|
47
|
-
req = Request.new(env)
|
48
|
-
signer().sign(req)
|
49
|
-
@app.call(env)
|
50
|
-
end
|
51
|
-
|
52
|
-
private
|
53
|
-
def normalize_for_net_http!(env)
|
54
|
-
return unless @net_http
|
55
|
-
|
56
|
-
if Net::HTTP::HAVE_ZLIB
|
57
|
-
env.request_headers['Accept-Encoding'] ||= 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3'
|
58
|
-
end
|
59
|
-
|
60
|
-
env.request_headers['Accept'] ||= '*/*'
|
61
|
-
end
|
62
|
-
end
|