[Zope3-Users] z3c.jsonrpc response content type bug

Roger Ineichen dev at projekt01.ch
Tue Oct 28 04:07:38 EDT 2008


Hi Yuan

> Betreff: [Zope3-Users] z3c.jsonrpc response content type bug
> 
> When I use z3c.jsonrpc (svn head) to publish an object, the 
> response generated gets the content header:
> 
> Content-Type: application/x-javascript
> 
> According to the README.txt of the package:
> 
> This project provides the proposed request type 
> "application/json". The request type "application/json-rpc" 
> is supported as long it is not officialy deprecated.
> 
> And it also expects to receive a request with 'application/json'
> header. So this should be a bug.
> 
> To fix it, one just need to modify _prepareResult method in 
> the file publisher.py to change from
> 
>         # set content type
>         self.setHeader('content-type', 
> "application/x-javascript;charset=%s" \
>             % charset)
> 
> to
> 
>         # set content type
>         self.setHeader('content-type', "application/json;charset=%s" \
>             % charset)
> --
> Hong Yuan

Thanks for the hint. I'll take a look at that this week.
Regards
Roger Ineichen
_____________________________
END OF MESSAGE



More information about the Zope3-users mailing list