Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow default Java user agent #20

Closed
oliviercailloux opened this issue Feb 3, 2019 · 6 comments
Closed

Allow default Java user agent #20

oliviercailloux opened this issue Feb 3, 2019 · 6 comments

Comments

@oliviercailloux
Copy link

As indicated here, the javadoc tool must be told to change its User Agent, for the default one seems to be forbidden access to javadoc.io. And as indicated in a comment, the workaround of changing the default user agent for the javadoc tool doesn’t seem to work any more (that part is obviously not your fault).

Please consider hosting the service with a provider that does not exclude default Java user agent, for simpler (or even for possible!) access to the service.

(Not sure if this issue relates to #17, I suppose not, as that one is closed.)

@maxcellent
Copy link
Owner

This is unfortunately a limitation of Cloudflare. It seems there is no way from Dashboard to whitelist a specific user agent

I am reaching out them to seek for a solution. If this cannot be workarounded, then will add SO hacks to homepage as a reference to other developers.

@maxcellent
Copy link
Owner

This unfortunately cannot be easily workarounded with cloudflare.

I am trying to switch to AWS cloudfront.

@maxcellent
Copy link
Owner

Unfortunately AWS cloudfront is not an option because they don't provide SSL solution. I have linked SO from homepage though.

@maxcellent
Copy link
Owner

In fact, Cloudflare guys helped solving the issue.

curl -I -A "Java/1.6.0_14" https://static.javadoc.io/org.checkerframework/checker-qual/2.2.2/package-list
HTTP/1.1 200 OK
Date: Mon, 08 Apr 2019 13:06:04 GMT
Content-Type: text/plain

@abhin4v
Copy link

abhin4v commented May 31, 2019

I'm using maven to generate javadocs and I'm running into the same issue. This is my maven javadoc plugin config:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>3.1.0</version>
    <configuration>
        <links>
            <link>https://static.javadoc.io/org.asynchttpclient/async-http-client/2.9.0/</link>
        </links>
    </configuration>
</plugin>

I get this error when I run the javadoc generation with maven in debug mode:

[DEBUG] Could not follow https://static.javadoc.io/org.asynchttpclient/async-http-client/2.9.0/. Reason: Unexpected HTTP status code 403 getting resource https://static.javadoc.io/org.asynchttpclient/async-http-client/2.9.0/.

@abhin4v
Copy link

abhin4v commented May 31, 2019

I have narrowed it down to the the followLinks method in the maven-javadoc-plugin. The javadoc says:

 /**
 * Follows all of the given links, and returns their last redirect locations. Ordering is kept.
 * This is necessary because javadoc tool doesn't follow links, see JDK-8190312 (MJAVADOC-427, MJAVADOC-487)
 *
 * @param links Links to follow.
 * @return Last redirect location of all the links.
 */

But hitting a URL like https://static.javadoc.io/org.asynchttpclient/async-http-client/2.9.0/ returns a 403 response instead of the index.html page as other HTTP servers generally do.

So the solution would be to configure the server serving static.javadoc.io to return the index.html files corresponding to the valid URLs ending with /.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants