request_id 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/request_id.rb +1 -1
- data/lib/request_id/version.rb +1 -1
- data/spec/rack/request_id_spec.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04f6bb692a9428eae84c65802ef209c801b5f621
|
4
|
+
data.tar.gz: d9d99f2739d1f495b2872ff54c3b48171ba4941b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a387cc775203c7f9a3726c430059e39d0bad5b2a68356db35200211f314d0b23b537f503a61fb55debb355294daf4ebd0f577b753fdff24b33f3c6bc664de96
|
7
|
+
data.tar.gz: 7a8ca15f5175521d60a9c42d6d4cede5cde21d26265b67df1234a65d5bba226de805001e23f900d739af7bdbb6736dd55c09a3d080eb2cb3a4fa73a0d9bd1dbe
|
data/lib/rack/request_id.rb
CHANGED
@@ -17,7 +17,7 @@ module Rack
|
|
17
17
|
# logger.info "request_id=#{Thread.current[:request_id]} Hello world"
|
18
18
|
# # => request_id=a08a6712229fb991c0e5026c246862c7 Hello world
|
19
19
|
class RequestId
|
20
|
-
REQUEST_HEADER = '
|
20
|
+
REQUEST_HEADER = 'HTTP_X_REQUEST_ID'.freeze
|
21
21
|
RESPONSE_HEADER = 'X-Request-Id'.freeze
|
22
22
|
|
23
23
|
def initialize(app, options = {})
|
data/lib/request_id/version.rb
CHANGED
@@ -12,11 +12,11 @@ describe Rack::RequestId do
|
|
12
12
|
Thread.current.should_receive(:[]=).with(:request_id, request_id)
|
13
13
|
app.should_receive(:call)
|
14
14
|
Thread.current.should_receive(:[]=).with(:request_id, nil)
|
15
|
-
middleware.call('
|
15
|
+
middleware.call('HTTP_X_REQUEST_ID' => request_id)
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'sets the X-Request-Id header in the response' do
|
19
|
-
status, headers, body = middleware.call('
|
19
|
+
status, headers, body = middleware.call('HTTP_X_REQUEST_ID' => request_id)
|
20
20
|
expect(headers['X-Request-Id']).to eq request_id
|
21
21
|
end
|
22
22
|
|
@@ -25,7 +25,7 @@ describe Rack::RequestId do
|
|
25
25
|
Thread.current.should_receive(:[]=).with(:request_id, request_id)
|
26
26
|
app.should_receive(:call).and_raise
|
27
27
|
Thread.current.should_receive(:[]=).with(:request_id, nil)
|
28
|
-
expect { middleware.call('
|
28
|
+
expect { middleware.call('HTTP_X_REQUEST_ID' => request_id) }.to raise_error
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: request_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric J. Holmes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.0.
|
103
|
+
rubygems_version: 2.0.14
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Classes for tracking request id
|