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

Issue 224098: Implement AbsolutePathLinkRewriter (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 10 months ago by johnfargo
Modified:
15 years, 10 months ago
Reviewers:
zhoresh, shindig.remailer
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

Rewrites relative links found in HTML to being absolute. This implementation may serve as an alternative to the use of a <base> tag. No Gadget/ContentRewriter is introduced in this CL as yet.

Patch Set 1 #

Patch Set 2 : Completed tests. #

Patch Set 3 : synced to head. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -0 lines) Patch
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/AbsolutePathLinkRewriter.java View 1 1 chunk +71 lines, -0 lines 1 comment Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/AbsolutePathLinkRewriterTest.java View 1 1 chunk +129 lines, -0 lines 1 comment Download

Messages

Total messages: 5
johnfargo
15 years, 10 months ago (2010-03-02 19:57:44 UTC) #1
johnfargo
Completed tests.
15 years, 10 months ago (2010-03-03 04:47:02 UTC) #2
johnfargo
synced to head.
15 years, 10 months ago (2010-03-03 19:52:56 UTC) #3
zhoresh
LGTM Minor comments http://codereview.appspot.com/224098/diff/2001/3001 File java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/AbsolutePathLinkRewriter.java (right): http://codereview.appspot.com/224098/diff/2001/3001#newcode58 java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/AbsolutePathLinkRewriter.java:58: } catch (Exception e) { Try ...
15 years, 10 months ago (2010-03-06 02:20:25 UTC) #4
johnfargo
15 years, 10 months ago (2010-03-08 22:35:15 UTC) #5
Thanks Ziv -- Responses inline.

On Fri, Mar 5, 2010 at 6:20 PM, <zhoresh@gmail.com> wrote:

> LGTM
>
> Minor comments
>
>
> http://codereview.appspot.com/224098/diff/2001/3001
> File
>
>
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/AbsolutePathLinkRewriter.java
> (right):
>
> http://codereview.appspot.com/224098/diff/2001/3001#newcode58
>
>
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/AbsolutePathLinkRewriter.java:58:
> } catch (Exception e) {
> Try to catch the specific exception you expect here.
> Other exception might be sign for bugs to fix?
>

Good call. Caught Uri.UriException instead, which is what was intended in
the first place.


>
> http://codereview.appspot.com/224098/diff/2001/3002
> File
>
>
>
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/AbsolutePathLinkRewriterTest.java
> (right):
>
> http://codereview.appspot.com/224098/diff/2001/3002#newcode37
>
>
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/AbsolutePathLinkRewriterTest.java:37:
> private static final Uri RELATIVE_URI = Uri.parse("/host/relative");
> Test also a local refeence (no /)
> Or same schema ("//a.com/a/b")
>

Added path-relative testing as well.


> And a bad element ("<a/>")


Added test to ensure that such an element is bypassed.


>
>
> http://codereview.appspot.com/224098/show
>
Sign in to reply to this message.

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