Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make Rack::Mime.match? conditionals a bit cleaner #513

Merged
merged 1 commit into from

2 participants

@spastorino
Owner

No description provided.

@raggi raggi merged commit 7b535cd into rack:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 15 deletions.
  1. +1 −15 lib/rack/mime.rb
View
16 lib/rack/mime.rb
@@ -29,21 +29,7 @@ def match?(value, matcher)
v1, v2 = value.split('/', 2)
m1, m2 = matcher.split('/', 2)
- if m1 == '*'
- if m2.nil? || m2 == '*'
- return true
- elsif m2 == v2
- return true
- else
- return false
- end
- end
-
- return false if v1 != m1
-
- return true if m2.nil? || m2 == '*'
-
- m2 == v2
+ (m1 == '*' || v1 == m1) && (m2.nil? || m2 == '*' || m2 == v2)
end
module_function :match?
Something went wrong with that request. Please try again.