xhummingbird 0.1.1 → 0.1.2

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: 3f5561122802f0f1a8c90a640b69802ed5dff468da607b47c7bfbff63eaf893c
4
- data.tar.gz: 871d26b48fb2a0dc04b8ec266c497b6366f04261e1af5c1012144f2ba9c21bfb
3
+ metadata.gz: cc55dc479a1ea3b8fba17b4f2f38a493fe1c190160a004585bcbd785fb0c9d21
4
+ data.tar.gz: a45754510d4490b253aeb9daec6360c37d52b662504a953a8bbb946fe134e191
5
5
  SHA512:
6
- metadata.gz: 1600c2a4cefa208e379da4313ff4a7bf9f66a21e56cfee784b24a479aa6e827c27a85be32657ceabf9c5fc796e17b3ea3f6b5c694c560f0da8f5141db628cb28
7
- data.tar.gz: ce403ecee0b90f896d1af6c5e760c6066abdb5ff57c444d15f4401c663e49ba47328bffa34f28524ae9895d0b0da3568055eadd03af472e734a8a5e1dab141e0
6
+ metadata.gz: 50f009f45946de188c80ba59e682a3d17496d3921192bc28432cc8f911a53f752ea1aaa1bae4864f4f2605f55a4628fab6bc39b87b0a447e21843bbd0f5f5bc7
7
+ data.tar.gz: 153ac10ec24214bc7edbcb70fa369cf905a6aaa2c29c547cd34a83014033798998d3401d11359344d543666297b49ab656e09dbb00a00b61eb4b81eea59758dc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xhummingbird (0.1.1)
4
+ xhummingbird (0.1.2)
5
5
  ffi-rzmq
6
6
  google-protobuf
7
7
 
@@ -1,13 +1,28 @@
1
1
  module Xhummingbird
2
2
  module Rack
3
3
  class CaptureException
4
+ CONVERT_KEYS = Set.new(%w(
5
+ REQUEST_METHOD
6
+ SCRIPT_NAME
7
+ PATH_INFO
8
+ QUERY_STRING
9
+ SERVER_NAME
10
+ SERVER_PORT
11
+ rack.version
12
+ rack.url_scheme
13
+ rack.multithread
14
+ rack.multiprocess
15
+ rack.run_once
16
+ rack.hijack?
17
+ ))
18
+
19
+ HTTP_HEADER_PREFIX = 'HTTP_'
20
+
4
21
  def initialize(app)
5
22
  @app = app
6
23
  end
7
24
 
8
25
  def call(env)
9
- p env
10
-
11
26
  begin
12
27
  response = @app.call(env)
13
28
  rescue => e
@@ -27,7 +42,9 @@ module Xhummingbird
27
42
  tags = {}
28
43
 
29
44
  env.each do |k, v|
30
- tags["rack_env/" + k.to_s] = v.to_s rescue nil
45
+ if CONVERT_KEYS.include?(k) || k.start_with?(HTTP_HEADER_PREFIX)
46
+ tags["rack_env/" + k.to_s] = v.to_s rescue nil
47
+ end
31
48
  end
32
49
 
33
50
  tags
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Xhummingbird
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xhummingbird
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - xmisao
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-27 00:00:00.000000000 Z
11
+ date: 2021-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi-rzmq