http_accept 0.1.4 → 0.1.5

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.
@@ -32,7 +32,7 @@ module HTTPAccept
32
32
  end
33
33
 
34
34
  def all_subtypes?
35
- format.match(/\/\*/, format.length-2) != nil
35
+ format.match(/\/\*\Z/) != nil
36
36
  end
37
37
 
38
38
  def all_types?
@@ -8,9 +8,10 @@ module HTTPAccept
8
8
  return [] unless @content
9
9
  content = @content.gsub(/\AAccept:\s*/, '')
10
10
  content.split(',').map { |s| s.strip }.map do |segment|
11
+ next nil if segment.empty?
11
12
  format, params = parse_params(segment)
12
13
  MediaType.new(:format => format, :params => params)
13
- end.sort
14
+ end.compact.sort
14
15
  end
15
16
 
16
17
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_accept
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: