Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature: remove ctype params #301
Some cases to demonstrate the changes:
Now we are returning a Content-Type without a charset, which is not ideal at all.
Which may be rather surprising to people.
With this patch
All content-type parameters are removed, and only if the content-type is "texty" do we add the charset back. This means users will have to explicitly add back any content-type paramaters.
All Content-Type parameters are removed, and the default charset is added because the new Content-Type is "texty".
This now correctly sets a charset Content-Type parameter to the default charset and we return a response to the client that makes sense.
This correctly removes all Content-Type parameters, and doesn't set the charset because
This does mean that if you want to explicitly keep the Content-Type parameters, you'll need to copy them and add them back after setting the Content-Type.
This will also reset the charset back to what it was previously.
This is a backwards incompatible change, but one that changes the API to one that has a lot less surprises in it.