[RFC][icedtea-web] Fix handling absolute paths passed into jnlp_href's value.

Jiri Vanek jvanek at redhat.com
Fri Apr 20 03:06:58 PDT 2012


On 03/12/2012 10:25 PM, Danesh Dadachanji wrote:
> Hi,
>
> The Knuddels test applet[1] uses an absolute path to the JNLP when using jnlp_href. Right now we
> assume it's a relative path and take the document base (i.e. the URL of the dir in which HTML file
> is located) concatenated with the value of jnlp_href for the new URL.
>
> The attached patch updates PluginBridge to handle absolute paths to the JNLP. I simply used the
> document base as the context to create a new URL. Based on the javadoc for this, if jnlp_href's
> value is not a properly formed URL, it will default to using the document base's URL as the base URL
> and append the relative part (value of jnlp_href) to the end of it.
>
> The URL constructor also handles relative paths so if codebase="../example.jnlp", the constructor
> will act accordingly and remove a dir if possible.
>
> +2012-03-09 Danesh Dadachanji <ddadacha at redhat.com>
> +
> + Fix to handle absolute paths passed into jnlp_href's value.
> + * netx/net/sourceforge/jnlp/PluginBridge.java
> + (PluginBridge): Use the document base as a context for the URL
> + being initialized by jnlp_href's value. This will automatically handle
> + relative and absolute URL paths.
> +
>
> Any comments? Can I push this to HEAD?
>
> NOTE: [1] still won't work because it has invalid XML. However you should see that it can now find
> the JNLP at the correct URL as opposed to
>
> java.io.IOException: http://chat.knuddels.de/http://www.knuddels.de/applet.jnlp[...]
>
> Regards,
> Danesh
>
> [1] www.knuddels.de:8080/index.html?v=90aez&c=7

This looks ok to me. Can you add unit tests please?

(feel free to some refactoring if necessary for testing purposes)


J.



More information about the distro-pkg-dev mailing list