It's really not obvious that nils are explicitly ignored here. Perhaps you could restructure it?
```
content_type = env['CONTENT_TYPE'].to_s.split(/\s*[;,]\s*/, 2).first
content_type &&= content_type.downcase
```

Something like this.