use of org.apache.http.impl.cookie.DefaultCookieSpecProvider in project fess-crawler by codelibs.
the class HcHttpClient method buildCookieSpecRegistry.
protected Lookup<CookieSpecProvider> buildCookieSpecRegistry() {
if (cookieSpecRegistry != null) {
return cookieSpecRegistry;
}
final PublicSuffixMatcher publicSuffixMatcher = PublicSuffixMatcherLoader.getDefault();
final CookieSpecProvider defaultProvider = new DefaultCookieSpecProvider(CompatibilityLevel.DEFAULT, publicSuffixMatcher, cookieDatePatterns, false);
final CookieSpecProvider laxStandardProvider = new RFC6265CookieSpecProvider(RFC6265CookieSpecProvider.CompatibilityLevel.RELAXED, publicSuffixMatcher);
final CookieSpecProvider strictStandardProvider = new RFC6265CookieSpecProvider(RFC6265CookieSpecProvider.CompatibilityLevel.STRICT, publicSuffixMatcher);
return //
RegistryBuilder.<CookieSpecProvider>create().register(CookieSpecs.DEFAULT, //
defaultProvider).register("best-match", //
defaultProvider).register("compatibility", //
defaultProvider).register(CookieSpecs.STANDARD, //
laxStandardProvider).register(CookieSpecs.STANDARD_STRICT, //
strictStandardProvider).register(CookieSpecs.NETSCAPE, //
new NetscapeDraftSpecProvider()).register(CookieSpecs.IGNORE_COOKIES, //
new IgnoreSpecProvider()).build();
}
use of org.apache.http.impl.cookie.DefaultCookieSpecProvider in project gradle by gradle.
the class HttpClientConfigurer method configureCookieSpecRegistry.
private void configureCookieSpecRegistry(HttpClientBuilder builder) {
PublicSuffixMatcher publicSuffixMatcher = PublicSuffixMatcherLoader.getDefault();
builder.setPublicSuffixMatcher(publicSuffixMatcher);
// Add more data patterns to the default configuration to work around https://github.com/gradle/gradle/issues/1596
final CookieSpecProvider defaultProvider = new DefaultCookieSpecProvider(DefaultCookieSpecProvider.CompatibilityLevel.DEFAULT, publicSuffixMatcher, new String[] { // Netscape expires pattern
"EEE, dd-MMM-yy HH:mm:ss z", DateUtils.PATTERN_RFC1036, DateUtils.PATTERN_ASCTIME, DateUtils.PATTERN_RFC1123 }, false);
final CookieSpecProvider laxStandardProvider = new RFC6265CookieSpecProvider(RFC6265CookieSpecProvider.CompatibilityLevel.RELAXED, publicSuffixMatcher);
final CookieSpecProvider strictStandardProvider = new RFC6265CookieSpecProvider(RFC6265CookieSpecProvider.CompatibilityLevel.STRICT, publicSuffixMatcher);
builder.setDefaultCookieSpecRegistry(RegistryBuilder.<CookieSpecProvider>create().register(CookieSpecs.DEFAULT, defaultProvider).register("best-match", defaultProvider).register("compatibility", defaultProvider).register(CookieSpecs.STANDARD, laxStandardProvider).register(CookieSpecs.STANDARD_STRICT, strictStandardProvider).register(CookieSpecs.NETSCAPE, new NetscapeDraftSpecProvider()).register(CookieSpecs.IGNORE_COOKIES, new IgnoreSpecProvider()).build());
}
Aggregations