Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for endswith (0.21 sec)

  1. samples/static-server/src/main/java/okhttp3/sample/SampleServer.java

        return result;
      }
    
      private String contentType(String path) {
        if (path.endsWith(".png")) return "image/png";
        if (path.endsWith(".jpg")) return "image/jpeg";
        if (path.endsWith(".jpeg")) return "image/jpeg";
        if (path.endsWith(".gif")) return "image/gif";
        if (path.endsWith(".html")) return "text/html; charset=utf-8";
        if (path.endsWith(".txt")) return "text/plain; charset=utf-8";
        return "application/octet-stream";
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Jan 02 02:50:44 GMT 2019
    - 4.7K bytes
    - Viewed (0)
  2. okhttp-java-net-cookiejar/src/main/kotlin/okhttp3/java/net/cookiejar/JavaNetCookieJar.kt

              header.trimSubstring(equalsSign + 1, pairEnd)
            } else {
              ""
            }
    
          // If the value is "quoted", drop the quotes.
          if (value.startsWith("\"") && value.endsWith("\"") && value.length >= 2) {
            value = value.substring(1, value.length - 1)
          }
    
          result.add(
            Cookie.Builder()
              .name(name)
              .value(value)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:10:43 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/-HostnamesCommon.kt

      if (":" in host) {
        // If the input is encased in square braces "[...]", drop 'em.
        val inetAddressByteArray =
          (
            if (host.startsWith("[") && host.endsWith("]")) {
              decodeIpv6(host, 1, host.length - 1)
            } else {
              decodeIpv6(host, 0, host.length)
            }
          ) ?: return null
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/-MediaTypeCommon.kt

          when {
            token == null -> {
              // Value is "double-quoted". That's valid and our regex group already strips the quotes.
              parameter.groups[3]!!.value
            }
            token.startsWith("'") && token.endsWith("'") && token.length > 2 -> {
              // If the token is 'single-quoted' it's invalid! But we're lenient and strip the quotes.
              token.substring(1, token.length - 1)
            }
            else -> token
          }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.1K bytes
    - Viewed (0)
  5. mockwebserver/src/test/java/mockwebserver3/internal/http2/Http2Server.kt

        return when {
          file.name.endsWith(".css") -> "text/css"
          file.name.endsWith(".gif") -> "image/gif"
          file.name.endsWith(".html") -> "text/html"
          file.name.endsWith(".jpeg") -> "image/jpeg"
          file.name.endsWith(".jpg") -> "image/jpeg"
          file.name.endsWith(".js") -> "application/javascript"
          file.name.endsWith(".png") -> "image/png"
          else -> "text/plain"
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/CacheTest.kt

        val response1 = client.newCall(request).execute()
        assertThat(response1.body.string()).isEqualTo("ABC")
        val cacheEntry =
          fileSystem.allPaths.stream()
            .filter { e: Path -> e.name.endsWith(".0") }
            .findFirst()
            .orElseThrow { NoSuchElementException() }
        corruptCertificate(cacheEntry)
        val response2 = client.newCall(request).execute() // Not Cached!
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 108.6K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/tls/OkHostnameVerifier.kt

        var pattern = pattern
        if (hostname.isNullOrEmpty() ||
          hostname.startsWith(".") ||
          hostname.endsWith("..")
        ) {
          // Invalid domain name.
          return false
        }
        if (pattern.isNullOrEmpty() ||
          pattern.startsWith(".") ||
          pattern.endsWith("..")
        ) {
          // Invalid pattern.
          return false
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 14:55:09 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/ws/MessageDeflater.kt

        require(deflatedBytes.size == 0L)
    
        if (noContextTakeover) {
          deflater.reset()
        }
    
        deflaterSink.write(buffer, buffer.size)
        deflaterSink.flush()
    
        if (deflatedBytes.endsWith(EMPTY_DEFLATE_BLOCK)) {
          val newSize = deflatedBytes.size - LAST_OCTETS_COUNT_TO_REMOVE_AFTER_DEFLATION
          deflatedBytes.readAndWriteUnsafe().use { cursor ->
            cursor.resizeBuffer(newSize)
          }
        } else {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/tls/ClientAuthTest.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.internal.tls
    
    import assertk.assertThat
    import assertk.assertions.endsWith
    import assertk.assertions.isEqualTo
    import assertk.assertions.isNull
    import assertk.assertions.startsWith
    import java.io.IOException
    import java.net.SocketException
    import java.security.GeneralSecurityException
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/CacheCorruptionTest.kt

        assertThat(cache.hitCount()).isEqualTo(0)
      }
    
      private fun corruptMetadata(corruptor: (String) -> String) {
        val metadataFile =
          fileSystem.allPaths.find {
            it.name.endsWith(".0")
          }
    
        if (metadataFile != null) {
          val contents =
            fileSystem.read(metadataFile) {
              readUtf8()
            }
    
          fileSystem.write(metadataFile) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 6K bytes
    - Viewed (1)
Back to top