ratchetio 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ module Ratchetio
4
4
 
5
5
  def ratchetio_request_data
6
6
  {
7
- :params => params.to_hash,
7
+ :params => ratchetio_filter_params(params),
8
8
  :url => ratchetio_request_url,
9
9
  :user_ip => ratchetio_user_ip,
10
10
  :headers => ratchetio_request_headers,
@@ -32,6 +32,27 @@ module Ratchetio
32
32
 
33
33
  private
34
34
 
35
+ def ratchetio_filter_params(params)
36
+ filtered = {}
37
+ params.to_hash.each_pair do |k,v|
38
+ if v.is_a? ActionDispatch::Http::UploadedFile
39
+ # only save content_type, original_filename, and length
40
+ begin
41
+ filtered[k] = {
42
+ :content_type => v.content_type,
43
+ :original_filename => v.original_filename,
44
+ :size => v.tempfile.size
45
+ }
46
+ rescue
47
+ filtered[k] = "Uploaded file"
48
+ end
49
+ else
50
+ filtered[k] = v
51
+ end
52
+ end
53
+ filtered
54
+ end
55
+
35
56
  def ratchetio_request_url
36
57
  url = "#{request.protocol}#{request.host}"
37
58
  unless [80, 443].include?(request.port)
@@ -1,3 +1,3 @@
1
1
  module Ratchetio
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ratchetio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-28 00:00:00.000000000 Z
12
+ date: 2012-10-17 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Rails plugin to catch and send exceptions to Ratchet.io
15
15
  email: