lib/sidekiq/web/helpers.rb in sidekiq-6.0.0.pre1 vs lib/sidekiq/web/helpers.rb in sidekiq-6.0.0
- old
+ new
@@ -82,10 +82,10 @@
# See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4
def user_preferred_languages
languages = env["HTTP_ACCEPT_LANGUAGE"]
languages.to_s.downcase.gsub(/\s+/, "").split(",").map { |language|
locale, quality = language.split(";q=", 2)
- locale = nil if locale == "*" # Ignore wildcards
+ locale = nil if locale == "*" # Ignore wildcards
quality = quality ? quality.to_f : 1.0
[locale, quality]
}.sort { |(_, left), (_, right)|
right <=> left
}.map(&:first).compact