You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Kevin Brown <et...@apache.org> on 2008/09/30 22:13:40 UTC

Re: Minor bug in DefaultContentRewriter causing gadgets to fail

Hi David,

No need to open up a JIRA issue for such a small patch, but in the future
feel free to send to shindig-dev in the future instead of directly to me.

I'll go ahead and fix this now.

Thanks!

On Tue, Sep 30, 2008 at 12:46 PM, Citron, David <dc...@sonusnet.com>wrote:

>  Hi!
>
>
>
> I spent a while debugging the following issue: gadgets with "script" tags
> that have relative URLs suddenly started failing.
>
>
>
> It turns out that the MutableContent change committed via r699132
> introduced a bug: the rewritten content is lost instead of being propagated
> back to the browser.
>
>
>
> The fix is quite trivial (see below). Would you like me to open a JIRA
> issue?
>
>
>
> Thanks so much!
>
> Dave
>
>
>
> Index:
> src/main/java/org/apache/shindig/gadgets/rewrite/lexer/DefaultContentRewriter.java
>
> ===================================================================
>
> ---
> src/main/java/org/apache/shindig/gadgets/rewrite/lexer/DefaultContentRewriter.java
> (revision 700551)
>
> +++
> src/main/java/org/apache/shindig/gadgets/rewrite/lexer/DefaultContentRewriter.java
> (working copy)
>
> @@ -114,7 +114,7 @@
>
>      StringWriter sw = new StringWriter();
>
>      GadgetSpec spec = gadget.getSpec();
>
>      if (rewrite(spec, spec.getUrl(), new
> StringReader(content.getContent()), "text/html", sw)) {
>
> -      gadget.setContent(sw.toString());
>
> +      content.setContent(sw.toString());
>
>      }
>
>      return RewriterResults.cacheableIndefinitely();
>
>    }
>