rack-log-request 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@ module Rack
25
25
  else
26
26
  @mongo_database = options[:mongo_db]
27
27
  end
28
- @mongo_collection = @mongo_database.collection('rack-log-request')
28
+ @mongo_collection = @mongo_database.create_collection('rack-log-request', {:capped => true, :size => 100, :max => 10})
29
29
  end
30
30
 
31
31
  def call(env)
@@ -33,7 +33,7 @@ module Rack
33
33
  status, headers, response = @app.call(env)
34
34
  @mongo_collection.insert({:request => env['REQUEST_URI'],
35
35
  :status => status,
36
- :size => response.body.size,
36
+ :size => headers['Content-Length'],
37
37
  :millis => (Time.now - t)*1000})
38
38
  return [status, headers, response]
39
39
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class LogRequest
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-log-request
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Cyril Mougel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-16 00:00:00 +01:00
18
+ date: 2011-03-17 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21