RFC2965Spec.java (httpcomponents-client-4.5.6-src) | : | RFC2965Spec.java (httpcomponents-client-4.5.7-src) | ||
---|---|---|---|---|
skipping to change at line 67 | skipping to change at line 67 | |||
* | * | |||
* @since 4.0 | * @since 4.0 | |||
* @see org.apache.http.impl.cookie.RFC6265StrictSpec | * @see org.apache.http.impl.cookie.RFC6265StrictSpec | |||
*/ | */ | |||
@Obsolete | @Obsolete | |||
@Contract(threading = ThreadingBehavior.SAFE) | @Contract(threading = ThreadingBehavior.SAFE) | |||
public class RFC2965Spec extends RFC2109Spec { | public class RFC2965Spec extends RFC2109Spec { | |||
/** | /** | |||
* Default constructor | * Default constructor | |||
* | ||||
*/ | */ | |||
public RFC2965Spec() { | public RFC2965Spec() { | |||
this(null, false); | this(null, false); | |||
} | } | |||
public RFC2965Spec(final String[] datepatterns, final boolean oneHeader) { | public RFC2965Spec(final String[] datepatterns, final boolean oneHeader) { | |||
super(oneHeader, | super(oneHeader, | |||
new RFC2965VersionAttributeHandler(), | new RFC2965VersionAttributeHandler(), | |||
new BasicPathHandler() { | new BasicPathHandler() { | |||
skipping to change at line 225 | skipping to change at line 224 | |||
* Set 'effective host name' as defined in RFC 2965. | * Set 'effective host name' as defined in RFC 2965. | |||
* <p> | * <p> | |||
* If a host name contains no dots, the effective host name is | * If a host name contains no dots, the effective host name is | |||
* that name with the string .local appended to it. Otherwise | * that name with the string .local appended to it. Otherwise | |||
* the effective host name is the same as the host name. Note | * the effective host name is the same as the host name. Note | |||
* that all effective host names contain at least one dot. | * that all effective host names contain at least one dot. | |||
* | * | |||
* @param origin origin where cookie is received from or being sent to. | * @param origin origin where cookie is received from or being sent to. | |||
*/ | */ | |||
private static CookieOrigin adjustEffectiveHost(final CookieOrigin origin) { | private static CookieOrigin adjustEffectiveHost(final CookieOrigin origin) { | |||
String host = origin.getHost(); | final String host = origin.getHost(); | |||
// Test if the host name appears to be a fully qualified DNS name, | // Test if the host name appears to be a fully qualified DNS name, | |||
// IPv4 address or IPv6 address | // IPv4 address or IPv6 address | |||
boolean isLocalHost = true; | boolean isLocalHost = true; | |||
for (int i = 0; i < host.length(); i++) { | for (int i = 0; i < host.length(); i++) { | |||
final char ch = host.charAt(i); | final char ch = host.charAt(i); | |||
if (ch == '.' || ch == ':') { | if (ch == '.' || ch == ':') { | |||
isLocalHost = false; | isLocalHost = false; | |||
break; | break; | |||
} | } | |||
} | } | |||
if (isLocalHost) { | return isLocalHost | |||
host += ".local"; | ? new CookieOrigin( | |||
return new CookieOrigin( | host + ".local", | |||
host, | origin.getPort(), | |||
origin.getPort(), | origin.getPath(), | |||
origin.getPath(), | origin.isSecure()) | |||
origin.isSecure()); | : origin; | |||
} else { | ||||
return origin; | ||||
} | ||||
} | } | |||
@Override | @Override | |||
public int getVersion() { | public int getVersion() { | |||
return 1; | return 1; | |||
} | } | |||
@Override | @Override | |||
public Header getVersionHeader() { | public Header getVersionHeader() { | |||
final CharArrayBuffer buffer = new CharArrayBuffer(40); | final CharArrayBuffer buffer = new CharArrayBuffer(40); | |||
End of changes. 3 change blocks. | ||||
12 lines changed or deleted | 8 lines changed or added |