Reviewers: zhoresh, johnfargo, chirag Done.
Description: Proxy servlet should not throw INTERNAL_SERVER_ERRORS whenever there is a rewriting exception. If it is possible to return the original content and the RETURN_ORIGINAL_CONTENT_ON_ERROR is set as "true", ProxyHandler should return the original content. To reproduce the exception, do the following: 1) Override ParseModule to use CajaHtmlParser instead of Neko. 2) Proxy a web page which caja fails on, so for example.org, load: gadgets/proxy?container=default&gadget=test&url=http%3A%2F%2Fwww.example.org %2F ProxyHandler then throws INTERNAL_SERVER_ERROR: org.apache.shindig.gadgets.rewrite.RewritingException: content.getDocument is null. Content: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- server: 155 mcn: in:/ci/content/current/site/index.html hostname: wci033, country: in, cluster: ind, created: 2010-08-03 14:51:45 --> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og=" http://opengraphprotocol.org/schema/" xmlns:fb=" http://developers.example.com/schema/" > <head> <title>Example.org </title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> ..... Please review this at http://codereview.appspot.com/1696059/show Affected files: M java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ProxyHandler.java M java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/ProxyUriManager.java M java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/UriCommon.java M java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyHandlerTest.java
