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

Issue 1869052: Modifying ProxyingVisitor to ignore malformed uris correctly (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 5 months ago by gagan.goku
Modified:
15 years, 5 months ago
Reviewers:
johnfargo, Kuntal Loya, dev-remailer, anupama.dutta
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

Currently ProxyingVisitor adds null to reservedUri list for uri's that are not parsed. It looks like its done in order to keep reserverUri list and node list in sync. However, this causes a NullPointerException in DefaultProxyUriManager:92. This change ignores the uri's (and corresponding nodes) which fail to parse.

Patch Set 1 #

Patch Set 2 : 'adding_test' #

Patch Set 3 : 'adding_test' #

Total comments: 8

Patch Set 4 : 'addressing_comments' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -27 lines) Patch
M java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java View 1 2 3 4 chunks +14 lines, -5 lines 0 comments Download
M java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitorTest.java View 2 3 3 chunks +10 lines, -22 lines 0 comments Download

Messages

Total messages: 8
johnfargo
http://codereview.appspot.com/1869052/diff/5001/6002 File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java (right): http://codereview.appspot.com/1869052/diff/5001/6002#newcode127 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java:127: for (Node node : reservedNodes) { This looks fine. ...
15 years, 5 months ago (2010-08-03 21:31:43 UTC) #1
gagan.goku
http://codereview.appspot.com/1869052/diff/5001/6002 File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java (right): http://codereview.appspot.com/1869052/diff/5001/6002#newcode127 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java:127: for (Node node : reservedNodes) { On 2010/08/03 21:31:43, ...
15 years, 5 months ago (2010-08-04 03:25:18 UTC) #2
anupama.dutta
LGTM for the fix. http://codereview.appspot.com/1869052/diff/5001/6001 File java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitorTest.java (right): http://codereview.appspot.com/1869052/diff/5001/6001#newcode83 java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitorTest.java:83: public void testMalformedUri() throws Exception ...
15 years, 5 months ago (2010-08-04 06:20:48 UTC) #3
Kuntal Loya
http://codereview.appspot.com/1869052/diff/5001/6002 File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java (right): http://codereview.appspot.com/1869052/diff/5001/6002#newcode109 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java:109: proxiedUri = new ProxyUriManager.ProxyUri(gadget, Uri.parse(uriStr)); This change is good, ...
15 years, 5 months ago (2010-08-04 06:21:30 UTC) #4
gagan.goku
http://codereview.appspot.com/1869052/diff/5001/6002 File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java (right): http://codereview.appspot.com/1869052/diff/5001/6002#newcode109 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java:109: proxiedUri = new ProxyUriManager.ProxyUri(gadget, Uri.parse(uriStr)); On 2010/08/04 06:21:30, Kuntal ...
15 years, 5 months ago (2010-08-04 06:43:48 UTC) #5
johnfargo
Sounds fine -- can't go wrong w/ well-formed input. On Tue, Aug 3, 2010 at ...
15 years, 5 months ago (2010-08-04 08:03:12 UTC) #6
johnfargo
committed as r982154 On Wed, Aug 4, 2010 at 1:03 AM, John Hjelmstad <johnfargo@gmail.com> wrote: ...
15 years, 5 months ago (2010-08-04 08:18:58 UTC) #7
gagan.goku
15 years, 5 months ago (2010-08-04 11:06:09 UTC) #8
Thanks John :)

On Wed, Aug 4, 2010 at 1:48 PM, John Hjelmstad <johnfargo@gmail.com> wrote:

> committed as r982154
>
>
> On Wed, Aug 4, 2010 at 1:03 AM, John Hjelmstad <johnfargo@gmail.com>wrote:
>
>> Sounds fine -- can't go wrong w/ well-formed input.
>>
>>
>> On Tue, Aug 3, 2010 at 8:25 PM, <gagan.goku@gmail.com> wrote:
>>
>>> Reviewers: dev-remailer_shindig.apache.org, johnfargo,
>>>
>>>
>>>
>>> http://codereview.appspot.com/1869052/diff/5001/6002
>>> File
>>>
>>>
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java
>>> (right):
>>>
>>> http://codereview.appspot.com/1869052/diff/5001/6002#newcode127
>>>
>>>
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java:127:
>>> for (Node node : reservedNodes) {
>>> On 2010/08/03 21:31:43, johnfargo wrote:
>>>
>>>> This looks fine. But it seems like a good idea to fix
>>>>
>>> DefaultProxyUriManager to
>>>
>>>> be null-tolerant as well. Thoughts?
>>>>
>>>
>>> It is possible, but not foolproof. If we handle null in
>>> DefaultProxyUriManager, we will also have to worry about inserting the
>>> null proxyUri back in the final returned list so that the list remains
>>> the same size as the original
>>> IMO, its better to ensure that we pass ProxyUriManager.make() the right
>>> input.
>>>
>>> Description:
>>> Currently ProxyingVisitor adds null to reservedUri list for uri's that
>>> are not parsed. It looks like its done in order to keep reserverUri list
>>> and node list in sync.
>>> However, this causes a NullPointerException in
>>> DefaultProxyUriManager:92.
>>>
>>> This change ignores the uri's (and corresponding nodes) which fail to
>>> parse.
>>>
>>> Please review this at http://codereview.appspot.com/1869052/show
>>>
>>> Affected files:
>>>  M
>>>
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitor.java
>>>  M
>>>
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/ProxyingVisitorTest.java
>>>
>>>
>>>
>>
>
Sign in to reply to this message.

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