[ 
https://issues.apache.org/jira/browse/CLIMATE-382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13948384#comment-13948384
 ] 

ASF GitHub Bot commented on CLIMATE-382:
----------------------------------------

GitHub user MJJoyce opened a pull request:

    https://github.com/apache/climate/pull/3

    CLIMATE-382 - Fix UI backend content type issues

    - Stop parsing JSON with ast.literal_eval in tests. Replace with the more
      correct json.loads.
    - json.dumps is no longer called on all output JSON. When returning
      plain JSON this was causing the content type to be incorrectly set as
      text. Now json.dumps is only called when returning a JSONP response so
      we have the dictionary properly serialized. Bottle handles
      automatically setting the content type when returning a dictionary, so
      we don't need to manually set the content-type.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MJJoyce/climate CLIMATE-382

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/climate/pull/3.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3
    
----
commit c1af36252894ac9d54a7237e65d62beafc7de659
Author: Michael Joyce <[email protected]>
Date:   2014-03-21T01:08:47Z

    CLIMATE-382 - Fix LFME content type issues
    
    - Stop parsing JSON with ast.literal_eval in tests. Replace with the more
      correct json.loads.
    - json.dumps is no longer called on all output JSON. When returning
      plain JSON this was causing the content type to be incorrectly set as
      text. Now json.dumps is only called when returning a JSONP response so
      we have the dictionary properly serialized. Bottle handles
      automatically setting the content type when returning a dictionary, so
      we don't need to manually set the content-type.

----


> UI backend return types aren't recognized as JSON
> -------------------------------------------------
>
>                 Key: CLIMATE-382
>                 URL: https://issues.apache.org/jira/browse/CLIMATE-382
>             Project: Apache Open Climate Workbench
>          Issue Type: Bug
>          Components: webapp
>    Affects Versions: 0.3-incubating
>            Reporter: Michael Joyce
>            Assignee: Michael Joyce
>             Fix For: 0.4
>
>
> A number of the UI backend endpoints return JSON without setting the request 
> header to indicate as such. Bottle doesn't figure this out on its own so a 
> number of the tests are pulling JSON from request.text instead of the 
> expected request.json. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to