- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for topPrivateDomain (0.07 sec)
-
okhttp/src/jvmTest/kotlin/okhttp3/HttpUrlJvmTest.kt
.isEqualTo("xn--ewv.xn--4pvxs.jp") assertThat("https://co.uk".toHttpUrl().topPrivateDomain()).isNull() assertThat("https://square".toHttpUrl().topPrivateDomain()).isNull() assertThat("https://栃木.jp".toHttpUrl().topPrivateDomain()).isNull() assertThat("https://xn--4pvxs.jp".toHttpUrl().topPrivateDomain()).isNull() assertThat("https://localhost".toHttpUrl().topPrivateDomain()).isNull()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 12K bytes - Viewed (0) -
android-test/src/test/kotlin/okhttp/android/test/BaseOkHttpClientUnitTest.kt
assertThat(response.cacheResponse).isNotNull() } } @Test open fun testPublicSuffixDb() { val httpUrl = "https://www.google.co.uk".toHttpUrl() assertThat(httpUrl.topPrivateDomain()).isEqualTo("google.co.uk") } private fun assumeNetwork() { try { InetAddress.getByName("www.google.com") } catch (uhe: UnknownHostException) {
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Tue Jul 22 20:03:31 UTC 2025 - 2.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/net/InternetDomainNameTest.java
InternetDomainName googleDomain = InternetDomainName.from("google.com"); assertEquals(googleDomain, googleDomain.topPrivateDomain()); assertEquals(googleDomain, googleDomain.child("mail").topPrivateDomain()); assertEquals(googleDomain, googleDomain.child("foo.bar").topPrivateDomain()); } public void testInvalidTopPrivateDomain() {
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 17.5K bytes - Viewed (0) -
native-image-tests/src/test/kotlin/okhttp3/nativeimage/PublicSuffixDatabaseTest.kt
import org.junit.jupiter.api.Test class PublicSuffixDatabaseTest { @Test fun testResourcesLoaded() { val url = "https://api.twitter.com".toHttpUrl() assertThat(url.topPrivateDomain()).isEqualTo("twitter.com") }
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Fri Jul 04 08:15:11 UTC 2025 - 964 bytes - Viewed (0) -
android-test-app/src/main/kotlin/okhttp/android/testapp/MainActivity.kt
val client = OkHttpClient() // Ensure we are compiling against the right variant println(AndroidPlatform.isSupported) val url = "https://github.com/square/okhttp".toHttpUrl() println(url.topPrivateDomain()) client.newCall(Request(url)).enqueue( object : Callback { override fun onFailure( call: Call, e: IOException, ) { println("failed: $e")
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Tue Aug 19 08:10:39 UTC 2025 - 1.7K bytes - Viewed (0) -
android-test/src/test/kotlin/okhttp/android/test/DisabledInitialiserTest.kt
Platform.resetForTests() PlatformRegistry.applicationContext = null } @Test fun testWithoutContext() { val httpUrl = "https://www.google.co.uk".toHttpUrl() assertFailure { httpUrl.topPrivateDomain() }.all { hasMessage("Unable to load PublicSuffixDatabase.list resource.") cause().isNotNull().all { hasMessage( "Platform applicationContext not initialized. " +
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Aug 30 16:25:39 UTC 2025 - 2.1K bytes - Viewed (0) -
android/guava/src/com/google/common/net/InternetDomainName.java
* controls. * * @throws IllegalStateException if this domain does not end with a public suffix * @since 6.0 */ public InternetDomainName topPrivateDomain() { if (isTopPrivateDomain()) { return this; } checkState(isUnderPublicSuffix(), "Not under a public suffix: %s", name); return ancestor(publicSuffixIndex() - 1); } /**
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 27.9K bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt
val redact: String = httpUrl.redact() var builder: HttpUrl.Builder = httpUrl.newBuilder() var resolveBuilder: HttpUrl.Builder? = httpUrl.newBuilder("") val topPrivateDomain: String? = httpUrl.topPrivateDomain() val resolve: HttpUrl? = httpUrl.resolve("") val getFromUrl: HttpUrl? = URL("").toHttpUrlOrNull() val getFromUri: HttpUrl? = URI("").toHttpUrlOrNull()
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Sat Jun 21 20:36:35 UTC 2025 - 46.5K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/Cookie.kt
@get:JvmName("hostOnly") val hostOnly: Boolean, /** * Returns a string describing whether this cookie is sent for cross-site calls. * * Two URLs are on the same site if they share a [top private domain][HttpUrl.topPrivateDomain]. * Otherwise, they are cross-site URLs. * * When a URL is requested, it may be in the context of another URL. *
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon May 05 16:01:00 UTC 2025 - 23.1K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/HttpUrl.kt
* * In general this method **should not** be used to test whether a domain is valid or routable. * Instead, DNS is the recommended source for that information. * * | URL | `topPrivateDomain()` | * | :---------------------------- | :------------------- | * | `http://google.com` | `"google.com"` | * | `http://adwords.google.co.uk` | `"google.co.uk"` |
Registered: Fri Sep 05 11:42:10 UTC 2025 - Last Modified: Mon May 05 16:01:00 UTC 2025 - 63.5K bytes - Viewed (0)