Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ad hoc content type handling in Entity w/MediaType struct #2

Open
pcantrell opened this issue Aug 24, 2015 · 0 comments
Open

Comments

@pcantrell
Copy link
Member

Entity’s handling of media types has several related subtle flaws:

  • Entity returns the content type as an unparsed string, which maybe contain obscure media type options (text/x.vnd.crazy+plain; charset=utf-8; vndparam=whatever) and thus be difficult to work with.
  • Related to the above, the nice media type matching available to ResponseTransformers isn't available anywhere else.
  • The code leans on NSHTTPURLResponse to extract the charset, which means that charset is confusingly a stored property where contentType and etag are derived from headers. This means that (1) contentType and charset can conflict, and (2) charset is an annoying special case in the init & serialization code.

A nice solution to all these things would be to expose a robust MediaType struct instead of a raw string. Something to do after all the basics are in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant