mu 5.7.20 → 5.7.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/mu/har.rb +17 -8
  2. data/version.rb +1 -1
  3. metadata +14 -14
data/lib/mu/har.rb CHANGED
@@ -103,15 +103,25 @@ class Har
103
103
  # Build the hosts list
104
104
  host = nil
105
105
  m = entry["musl"] = {}
106
- m["url_object"] = URI.parse entry["request"]["url"]
107
106
  m["url"] = {}
107
+ # Put this rescue in place for when a url doesn't parse correctly, which is a fairly rare corner case
108
+ # Example: http://online.wsj.com/api-video/get_video_info.asp?guid={65EDE7D2-9261-4C47-BB01-DB841CBA209A}&fields=all&dojo.preventCache=1304591152604
109
+ # The example fails because of the {} so in this rare case I escape the url to pull out the relevant parts and then restore it
110
+ begin
111
+ m["url_object"] = URI.parse entry["request"]["url"]
112
+ m["url"]["search"] = m["url_object"].query || ''
113
+ # The m["url_object"].query doesn't return the leading ? for a search string so we have to add it
114
+ m["url"]["search"] = "?" + m["url"]["search"] unless m["url"]["search"] == ''
115
+ m["url"]["hash"] = m["url_object"].fragment || ''
116
+ rescue => e
117
+ m["url_object"] = URI.parse URI.escape entry["request"]["url"]
118
+ m["url"]["search"] = URI.unescape m["url_object"].query || ''
119
+ m["url"]["search"] = "?" + m["url"]["search"] unless m["url"]["search"] == ''
120
+ m["url"]["hash"] = URI.unescape m["url_object"].fragment || ''
121
+ end
108
122
  m['url']['port'] = m["url_object"].port || (m["url_object"].scheme === 'http' ? 80 : 443)
109
123
  m['url']['pathname'] = m['url_object'].path || '/'
110
- m["url"]["search"] = m["url_object"].query || ''
111
- m["url"]["hash"] = m["url_object"].fragment || ''
112
- require 'pp'
113
- #pp entry if entry['request']['headers'].length < 1
114
- #raise "die" if entry['request']['headers'].length < 1
124
+
115
125
 
116
126
  # Create the host entry hash with underscores instead of dots for the host value
117
127
  entry['request']['headers'].each do |header|
@@ -149,7 +159,7 @@ class Har
149
159
  end
150
160
  rescue Exception => e
151
161
  puts e.message
152
- puts e.backtrace.inspect
162
+ puts e.backtrace
153
163
  raise e
154
164
  end
155
165
 
@@ -275,7 +285,6 @@ class Har
275
285
  # Create the xport options in the scenario
276
286
  if(@options.skip_ssl_passthru)
277
287
  xklass = 'tcp' if xklass == 'ssl'
278
- xopts['dst_port'] = 80 if xopts['dst_port'] === 443
279
288
  end
280
289
  steps.xport("xport#{entry_count}", xklass, xopts)
281
290
 
data/version.rb CHANGED
@@ -1 +1 @@
1
- VERSION='5.7.20'
1
+ VERSION='5.7.21'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mu
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.7.20
4
+ version: 5.7.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-05-04 00:00:00.000000000 -07:00
12
+ date: 2011-05-05 00:00:00.000000000 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
17
- requirement: &18904220 !ruby/object:Gem::Requirement
17
+ requirement: &16410060 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.4.4
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *18904220
25
+ version_requirements: *16410060
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rest-client
28
- requirement: &18903720 !ruby/object:Gem::Requirement
28
+ requirement: &16409500 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.6.1
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *18903720
36
+ version_requirements: *16409500
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: mime-types
39
- requirement: &18903180 !ruby/object:Gem::Requirement
39
+ requirement: &16408820 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '1.16'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *18903180
47
+ version_requirements: *16408820
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: json
50
- requirement: &18902800 !ruby/object:Gem::Requirement
50
+ requirement: &16408320 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *18902800
58
+ version_requirements: *16408320
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: hexy
61
- requirement: &18902120 !ruby/object:Gem::Requirement
61
+ requirement: &16407580 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 0.1.1
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *18902120
69
+ version_requirements: *16407580
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: uuid
72
- requirement: &18901600 !ruby/object:Gem::Requirement
72
+ requirement: &16406880 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,7 +77,7 @@ dependencies:
77
77
  version: 2.0.2
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *18901600
80
+ version_requirements: *16406880
81
81
  description: ! "The Mu gem allows users to include mu libraries within scripts\n that
82
82
  interact with mu appliance software. The gem also supplies command line interfaces\n
83
83
  \ to many of these same libraries"