Deprecated internal punycode implementation in favor of standard java.net.IDN
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1620942 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
221e7ba59e
commit
1e2d2f38a0
|
@ -29,8 +29,11 @@ package org.apache.http.client.utils;
|
||||||
/**
|
/**
|
||||||
* Abstraction of international domain name (IDN) conversion.
|
* Abstraction of international domain name (IDN) conversion.
|
||||||
*
|
*
|
||||||
|
* @deprecated (4.4) use standard {@link java.net.IDN}.
|
||||||
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public interface Idn {
|
public interface Idn {
|
||||||
/**
|
/**
|
||||||
* Converts a name from its punycode representation to Unicode.
|
* Converts a name from its punycode representation to Unicode.
|
|
@ -34,9 +34,12 @@ import org.apache.http.annotation.Immutable;
|
||||||
/**
|
/**
|
||||||
* Uses the java.net.IDN class through reflection.
|
* Uses the java.net.IDN class through reflection.
|
||||||
*
|
*
|
||||||
|
* @deprecated (4.4) use standard {@link java.net.IDN}.
|
||||||
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
|
@Deprecated
|
||||||
public class JdkIdn implements Idn {
|
public class JdkIdn implements Idn {
|
||||||
private final Method toUnicode;
|
private final Method toUnicode;
|
||||||
|
|
|
@ -32,9 +32,12 @@ import org.apache.http.annotation.Immutable;
|
||||||
* Facade that provides conversion between Unicode and Punycode domain names.
|
* Facade that provides conversion between Unicode and Punycode domain names.
|
||||||
* It will use an appropriate implementation.
|
* It will use an appropriate implementation.
|
||||||
*
|
*
|
||||||
|
* @deprecated (4.4) use standard {@link java.net.IDN}.
|
||||||
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
|
@Deprecated
|
||||||
public class Punycode {
|
public class Punycode {
|
||||||
private static final Idn impl;
|
private static final Idn impl;
|
||||||
static {
|
static {
|
|
@ -33,9 +33,12 @@ import org.apache.http.annotation.Immutable;
|
||||||
/**
|
/**
|
||||||
* Implementation from pseudo code in RFC 3492.
|
* Implementation from pseudo code in RFC 3492.
|
||||||
*
|
*
|
||||||
|
* @deprecated (4.4) use standard {@link java.net.IDN}.
|
||||||
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
|
@Deprecated
|
||||||
public class Rfc3492Idn implements Idn {
|
public class Rfc3492Idn implements Idn {
|
||||||
private static final int base = 36;
|
private static final int base = 36;
|
||||||
private static final int tmin = 1;
|
private static final int tmin = 1;
|
|
@ -26,11 +26,11 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.http.impl.cookie;
|
package org.apache.http.impl.cookie;
|
||||||
|
|
||||||
|
import java.net.IDN;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.http.client.utils.Punycode;
|
|
||||||
import org.apache.http.cookie.Cookie;
|
import org.apache.http.cookie.Cookie;
|
||||||
import org.apache.http.cookie.CookieAttributeHandler;
|
import org.apache.http.cookie.CookieAttributeHandler;
|
||||||
import org.apache.http.cookie.CookieOrigin;
|
import org.apache.http.cookie.CookieOrigin;
|
||||||
|
@ -101,7 +101,7 @@ public class PublicSuffixFilter implements CookieAttributeHandler {
|
||||||
if (domain.startsWith(".")) {
|
if (domain.startsWith(".")) {
|
||||||
domain = domain.substring(1);
|
domain = domain.substring(1);
|
||||||
}
|
}
|
||||||
domain = Punycode.toUnicode(domain);
|
domain = IDN.toUnicode(domain);
|
||||||
|
|
||||||
// An exception rule takes priority over any other matching rule.
|
// An exception rule takes priority over any other matching rule.
|
||||||
if (this.exceptions != null) {
|
if (this.exceptions != null) {
|
||||||
|
|
Loading…
Reference in New Issue