This might be a bit more concise:

```ruby
if second
   # HTTP spec defines only dash-based languages, se we need to convert and add a fallback
   return ["#{first.downcase}-#{second.upcase}", first.downcase]
else
   return [first.downcase]
end
```