robertodecurnex/rack-jsonp-middleware — pull request #4 by amiel (2012-07-24 21:04:13+00:00)
Title: Content type fix

**NOTE:** This pull request depends on #3 (and/or includes #3)...

## Background

rack-jsonp-middleware forces the response `Content-Type` header to be:

`Content-Type: application/javascript`

The idea was to change:

```diff
- Content-Type: application/json
+ Content-Type: application/javascript
```

However, if the previous `Content-Type` had the `charset` suffix, then it would be overwritten like so:

```diff
- Content-Type: application/json; charset=utf-8
+ Content-Type: application/javascript
```

## This pull request fixes that

It works by splitting on `;` and only altering the first part.

Cheers :beers: