POST errors if content type has 'charset' setting

Issue #126 duplicate
Anonymous created an issue

The following is a fairly common 'content-type' setting... "application/json; charset=UTF-8" ...which will cause POST to error out in Piston.

Comments (3)

  1. Anonymous

    I fixed this by hacking piston/, starting around line 168, to say this:

        def loader_for_type(self, ctype):
            Gets a function ref to deserialize content
            for a certain mimetype.
            for loadee, mimes in Mimer.TYPES.iteritems():
                for mime in mimes:
                    if ctype.startswith(mime):
                        return loadee
  2. Georg Bauer

    hit the same problem and "fixed" it by monkeypatching the Mimer class (since I didn't want to change the stock piston source as it is usually installed via pip around here).

  3. Log in to comment