Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] URLs with IDN domains in jetty-client doesn't work

I thought to just throw an exception and do it early (from `newRequest`). 
Another justification to this is that `newRequest`'s parameter is called uri and RFC 3986 for URI says that only part of ascii and percent-encoded can be used there.

We have a workaround in our code to support IDNs but it could be unreliable because it use `j.n.URL` to parse original url string and builds URI back from it.
It also could stop working with IDNs since it isn't obligated to work with them at all.

I think, normal IDN support would be a huge task since it should affect not only creating requests but things like correct redirect and cookies handling at least.

вт, 13 дек. 2016 г. в 17:14, Simone Bordet <sbordet@xxxxxxxxxxx>:
Hi,

On Tue, Dec 13, 2016 at 2:59 PM, Konstantin Gribov <grossws@xxxxxxxxx> wrote:
> Hi, folks.
>
> I've found that jetty-client (9.3.11 and 9.3.14 at least) fails to work with
> international domain names if they are not encoded to punycode.
>
> The code like `HttpClient.newRequest("http://кто.рф").send()` will fail with
> NPE thrown from `send` invocation because `newRequest(String)` use
> `j.n.URI.create(String)` which returns URI with `null` in its host.
>
> I think, it would be better to add some note to `newRequest`'s javadoc about
> such behavior and create more meaningfull exception which should be thrown
> from `newRequest` and not from `send` which can be called several hundred
> lines later.
>
> Do you accept pull requests at github, I forgot?

Yes we do accept PR at GitHub, but make sure you follow the
contribution guidelines here:
http://www.eclipse.org/jetty/documentation/9.3.x/contributing-patches.html

The patch would be to throw a better exception or to allow
international host names ?

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev
--

Best regards,
Konstantin Gribov


Back to the top