Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Issue 1032045: JSON-RPC over JSONP support (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 8 months ago by Paul Lindner
Modified:
15 years, 8 months ago
Reviewers:
johnfargo, shindig.remailer
Visibility:
Public.

Patch Set 1 #

Total comments: 8

Patch Set 2 : Updated jsonp code #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -69 lines) Patch
M java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java View 1 2 chunks +23 lines, -1 line 2 comments Download
M java/common/src/main/java/org/apache/shindig/common/util/JsonConversionUtil.java View 2 chunks +6 lines, -4 lines 0 comments Download
M java/common/src/main/java/org/apache/shindig/protocol/JsonRpcServlet.java View 1 7 chunks +92 lines, -55 lines 4 comments Download
M java/common/src/test/java/org/apache/shindig/common/util/JsonConversionUtilTest.java View 3 chunks +13 lines, -0 lines 2 comments Download
M java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/RpcServlet.java View 1 4 chunks +2 lines, -9 lines 2 comments Download

Messages

Total messages: 9
Paul Lindner
15 years, 8 months ago (2010-05-01 01:51:30 UTC) #1
johnfargo
http://codereview.appspot.com/1032045/diff/1/2 File java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java (right): http://codereview.appspot.com/1032045/diff/1/2#newcode123 java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java:123: throw new IllegalArgumentException("Wrong format for parameter 'callback' specified. Must ...
15 years, 8 months ago (2010-05-01 02:41:06 UTC) #2
Paul Lindner
new patch coming.. http://codereview.appspot.com/1032045/diff/1/4 File java/common/src/main/java/org/apache/shindig/protocol/JsonRpcServlet.java (right): http://codereview.appspot.com/1032045/diff/1/4#newcode95 java/common/src/main/java/org/apache/shindig/protocol/JsonRpcServlet.java:95: if ((content.indexOf('[') != -1) && content.indexOf('[') ...
15 years, 8 months ago (2010-05-02 23:50:56 UTC) #3
Paul Lindner
15 years, 8 months ago (2010-05-02 23:52:18 UTC) #4
johnfargo
http://codereview.appspot.com/1032045/diff/6001/7001 File java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java (right): http://codereview.appspot.com/1032045/diff/6001/7001#newcode130 java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java:130: return true; why not just return the matched callback ...
15 years, 8 months ago (2010-05-03 23:04:53 UTC) #5
Paul Lindner
fixed nits, will commit if no objections. http://codereview.appspot.com/1032045/diff/6001/7001 File java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java (right): http://codereview.appspot.com/1032045/diff/6001/7001#newcode130 java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java:130: return true; ...
15 years, 8 months ago (2010-05-04 01:45:04 UTC) #6
johnfargo
On Mon, May 3, 2010 at 6:45 PM, <lindner@inuus.com> wrote: > fixed nits, will commit ...
15 years, 8 months ago (2010-05-04 01:47:46 UTC) #7
Paul Lindner
On Mon, May 3, 2010 at 6:47 PM, John Hjelmstad <johnfargo@gmail.com> wrote: > On Mon, ...
15 years, 8 months ago (2010-05-04 01:52:43 UTC) #8
johnfargo
15 years, 8 months ago (2010-05-04 01:53:15 UTC) #9
Your choice; I'll LGTM this either way.

On Mon, May 3, 2010 at 6:52 PM, Paul Lindner <lindner@inuus.com> wrote:

> On Mon, May 3, 2010 at 6:47 PM, John Hjelmstad <johnfargo@gmail.com>wrote:
>
>> On Mon, May 3, 2010 at 6:45 PM, <lindner@inuus.com> wrote:
>>
>> > fixed nits, will commit if no objections.
>> >
>>
>> No objections per se, but commentary.
>>
>>
>> >
>> >
>> >
>> > http://codereview.appspot.com/1032045/diff/6001/7001
>> > File
>> >
>> java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java
>> > (right):
>> >
>> > http://codereview.appspot.com/1032045/diff/6001/7001#newcode130
>> >
>> >
>>
java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java:130:
>> > return true;
>> > On 2010/05/03 23:04:54, johnfargo wrote:
>> >
>> >> why not just return the matched callback param to encapsulate logic?
>> >>
>> >
>> > This logic has three states - callback valid, callback invalid, no
>> > callback, so just returning the param doesn't cut it.  An IAE seems
>> > appropriate since malformed callbacks should be relatively rare and
>> > should result in a 400 response.
>> >
>>
>> I assumed callback invalid -> exception, so valid vs. no callback is null
>> vs. String.
>
>
> okay, that seems fine.
>
>
>>
>> >
>> > http://codereview.appspot.com/1032045/diff/6001/7003
>> > File
>> >
>> java/common/src/main/java/org/apache/shindig/protocol/JsonRpcServlet.java
>> > (right):
>> >
>> > http://codereview.appspot.com/1032045/diff/6001/7003#newcode86
>> >
>> >
>> java/common/src/main/java/org/apache/shindig/protocol/JsonRpcServlet.java:86:
>> > if (!("GET".equals(method) || "POST".equals(method))) {
>> > On 2010/05/03 23:04:54, johnfargo wrote:
>> >
>> >> can't this just be enforced by direct use?
>> >>
>> >
>> > not sure what you mean here.  I combined doGet and doPost here to
>> > eliminate duplicate code paths.  In doing so we need to reject methods
>> > we can't handle.
>> >
>>
>> I was advocating for getting rid of the check. If you only call this from
>> doGet and doPost, you're already implicitly checking method.
>>
>>
> I suppose I could rename service() to something like dispatch() and have
> doGet/doPost call that.  Seems a little cluttered imho, but I can make the
> change.
>
>
>>
>> >
>> > http://codereview.appspot.com/1032045/diff/6001/7003#newcode87
>> >
>> >
>> java/common/src/main/java/org/apache/shindig/protocol/JsonRpcServlet.java:87:
>> > sendError(servletResponse, new
>> > ResponseItem(HttpServletResponse.SC_BAD_REQUEST, "Only POST/GET"));
>> > On 2010/05/03 23:04:54, johnfargo wrote:
>> >
>> >> still >100 char
>> >>
>> >
>> > Done.
>> >
>> > http://codereview.appspot.com/1032045/diff/6001/7004
>> > File
>> >
>> >
>>
java/common/src/test/java/org/apache/shindig/common/util/JsonConversionUtilTest.java
>> > (right):
>> >
>> > http://codereview.appspot.com/1032045/diff/6001/7004#newcode132
>> >
>> >
>>
java/common/src/test/java/org/apache/shindig/common/util/JsonConversionUtilTest.java:132:
>> > }
>> > On 2010/05/03 23:04:54, johnfargo wrote:
>> >
>> >> nit: 1-space off indent
>> >>
>> >
>> > Done.
>> >
>> > http://codereview.appspot.com/1032045/diff/6001/7005
>> > File
>> >
>> >
>> java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/RpcServlet.java
>> > (right):
>> >
>> > http://codereview.appspot.com/1032045/diff/6001/7005#newcode65
>> >
>> >
>>
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/RpcServlet.java:65:
>> > HttpUtil.isJSONP(request);
>> > On 2010/05/03 23:04:54, johnfargo wrote:
>> >
>> >> is this just for the side-effect of param validation?
>> >>
>> > Yes.  Comment added to describe this
>> >
>> > http://codereview.appspot.com/1032045/show
>> >
>>
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b