Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for strip (0.16 sec)

  1. okhttp/src/test/java/okhttp3/HttpUrlJvmTest.kt

      @Test
      fun hostContainsOnlyStrippedCharacters() {
        val url = "http://>/".toHttpUrl()
        assertThat(url.host).isEqualTo(">")
        assertThat(url.toUri().host).isNull()
      }
    
      /**
       * Strip unexpected characters when converting to URI (which is more strict).
       * https://github.com/square/okhttp/issues/5667
       */
      @Test
      fun hostToUriStripsCharacters() {
        val httpUrl = "http://example\".com/".toHttpUrl()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.9K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/-MediaTypeCommon.kt

            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)
  3. okhttp/src/test/java/okhttp3/CacheCorruptionTest.kt

        assertThat(cache.hitCount()).isEqualTo(0)
      }
    
      @Test fun corruptedUrl() {
        val response =
          testCorruptingCache {
            corruptMetadata {
              // strip https scheme
              it.substring(5)
            }
          }
    
        assertThat(response.body.string()).isEqualTo("ABC.2") // not cached
        assertThat(cache.requestCount()).isEqualTo(2)
    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)
  4. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

       *
       * If you're upgrading to OkHttp 4.6 and would like to retain the previous behavior, install this
       * as a **network interceptor**. It will strip the `Location` header of impacted responses to
       * prevent the redirect.
       *
       * ```
       * OkHttpClient client = client.newBuilder()
       *   .addNetworkInterceptor(new LegacyRedirectInterceptor())
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

          throw noMoreExchanges(e) as Throwable
        } finally {
          if (!calledNoMoreExchanges) {
            noMoreExchanges(null)
          }
        }
      }
    
      /**
       * Prepare for a potential trip through all of this call's network interceptors. This prepares to
       * find an exchange to carry the request.
       *
       * Note that an exchange will not be needed if the request is satisfied by the cache.
       *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 17.9K bytes
    - Viewed (2)
  6. docs/changelogs/changelog_4x.md

        consistent with the length of the response body.
    
     *  Fix: Don't crash when converting a `HttpUrl` instance with an unresolvable hostname to a URI.
        The new behavior strips invalid characters like `"` and `{` from the hostname before converting.
    
     *  Fix: Undo a performance regression introduced in OkHttp 4.0 caused by differences in behavior
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/HttpUrl.kt

        val uri = newBuilder().reencodeForUri().toString()
        return try {
          URI(uri)
        } catch (e: URISyntaxException) {
          // Unlikely edge case: the URI has a forbidden character in the fragment. Strip it & retry.
          try {
            val stripped = uri.replace(Regex("[\\u0000-\\u001F\\u007F-\\u009F\\p{javaWhitespace}]"), "")
            URI.create(stripped)
          } catch (e1: Exception) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 63.5K bytes
    - Viewed (1)
  8. okhttp/src/main/kotlin/okhttp3/internal/http/StatusLine.kt

            // Shoutcast uses ICY instead of "HTTP/1.0".
            protocol = Protocol.HTTP_1_0
            codeStart = 4
          } else if (statusLine.startsWith("SOURCETABLE ")) {
            // NTRIP r1 uses SOURCETABLE instead of HTTP/1.1
            protocol = Protocol.HTTP_1_1
            codeStart = 12
          } else {
            throw ProtocolException("Unexpected status line: $statusLine")
          }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/MultipartReaderTest.kt

          )
    
        assertFailsWith<EOFException> {
          parts.nextPart()
        }
      }
    
      /** Confirm that [MultipartBody] and [MultipartReader] can work together. */
      @Test fun `multipart round trip`() {
        val body =
          MultipartBody.Builder("boundary")
            .setType(MultipartBody.PARALLEL)
            .addPart("Quick".toRequestBody("text/plain".toMediaType()))
            .addFormDataPart("color", "Brown")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.8K bytes
    - Viewed (0)
  10. okhttp-brotli/src/main/kotlin/okhttp3/brotli/BrotliInterceptor.kt

    import okhttp3.Interceptor
    import okhttp3.Response
    import okhttp3.brotli.internal.uncompress
    
    /**
     * Transparent Brotli response support.
     *
     * Adds Accept-Encoding: br to request and checks (and strips) for Content-Encoding: br in
     * responses.  n.b. this replaces the transparent gzip compression in BridgeInterceptor.
     */
    object BrotliInterceptor : Interceptor {
      override fun intercept(chain: Interceptor.Chain): Response {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.3K bytes
    - Viewed (0)
Back to top