You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by de...@apache.org on 2010/11/15 23:09:06 UTC

svn commit: r1035472 - /maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java

Author: dennisl
Date: Mon Nov 15 22:09:05 2010
New Revision: 1035472

URL: http://svn.apache.org/viewvc?rev=1035472&view=rev
Log:
[DOXIA-417] The XmlParser is blocked from W3C URLs

Modified:
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java

Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java?rev=1035472&r1=1035471&r2=1035472&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java Mon Nov 15 22:09:05 2010
@@ -798,6 +798,9 @@ public abstract class AbstractXmlParser
             // it is an HTTP url, using HttpClient...
             DefaultHttpClient client = new DefaultHttpClient();
             HttpGet method = new HttpGet( url.toString() );
+            // Set a user-agent that doesn't contain the word "java", otherwise it will be blocked by the W3C
+            // The default user-agent is "Apache-HttpClient/4.0.2 (java 1.5)"
+            method.setHeader( "user-agent", "Apache-HttpClient/4.0.2" );
 
             HttpRequestRetryHandler retryHandler = new DefaultHttpRequestRetryHandler( 3, false );
             client.setHttpRequestRetryHandler(retryHandler);



Re: svn commit: r1035472 - /maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java

Posted by Benjamin Bentmann <be...@udo.edu>.
Hi Dennis,

> Author: dennisl
> Date: Mon Nov 15 22:09:05 2010
> New Revision: 1035472
>
> URL: http://svn.apache.org/viewvc?rev=1035472&view=rev
> Log:
> [DOXIA-417] The XmlParser is blocked from W3C URLs
>
> Modified:
>      maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
>
> Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
> URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java?rev=1035472&r1=1035471&r2=1035472&view=diff
> ==============================================================================
> --- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java (original)
> +++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java Mon Nov 15 22:09:05 2010
> @@ -798,6 +798,9 @@ public abstract class AbstractXmlParser
>               // it is an HTTP url, using HttpClient...
>               DefaultHttpClient client = new DefaultHttpClient();
>               HttpGet method = new HttpGet( url.toString() );
> +            // Set a user-agent that doesn't contain the word "java", otherwise it will be blocked by the W3C
> +            // The default user-agent is "Apache-HttpClient/4.0.2 (java 1.5)"
> +            method.setHeader( "user-agent", "Apache-HttpClient/4.0.2" );

Wouldn't it be more appropriate to use "Apache-Doxia" as user agent or 
otherwise indicate Doxia as the higher level app that issues the request?


Benjamin