Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for trailers (0.16 sec)

  1. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

      @JvmName("-deprecated_getTrailers")
      @Deprecated(
        message = "moved to var",
        replaceWith = ReplaceWith(expression = "trailers"),
        level = DeprecationLevel.ERROR,
      )
      fun getTrailers(): Headers = trailers
    
      fun setTrailers(trailers: Headers) = apply { this.trailers = trailers }
    
      @JvmName("-deprecated_getSocketPolicy")
      @Deprecated(
        message = "moved to var",
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  2. cmd/streaming-v4-unsigned.go

    func newUnsignedV4ChunkedReader(req *http.Request, trailer bool) (io.ReadCloser, APIErrorCode) {
    	if trailer {
    		// Discard anything unsigned.
    		req.Trailer = make(http.Header)
    		trailers := req.Header.Values(awsTrailerHeader)
    		for _, key := range trailers {
    			req.Trailer.Add(key, "")
    		}
    	} else {
    		req.Trailer = nil
    	}
    	return &s3UnsignedChunkedReader{
    		trailers: req.Trailer,
    		reader:   bufio.NewReader(req.Body),
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat May 06 02:53:12 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/ResponseJvmTest.kt

        assertThat(response.trailers()).isEmpty()
      }
    
      @Test
      fun testFailsIfTrailersNotSet() {
        val response =
          newResponse("".toResponseBody()) {
            // All live paths (Http1, Http2) in OkHttp do this
            trailers { error("trailers not available") }
          }
    
        assertFailsWith<IllegalStateException>(message = "trailers not available") {
          response.trailers()
        }
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2ExchangeCodec.kt

          else -> response.headersContentLength()
        }
      }
    
      override fun openResponseBodySource(response: Response): Source {
        return stream!!.source
      }
    
      override fun trailers(): Headers {
        return stream!!.trailers()
      }
    
      override fun cancel() {
        canceled = true
        stream?.closeLater(ErrorCode.CANCEL)
      }
    
      companion object {
        private const val CONNECTION = "connection"
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/HeadersRequestTest.kt

        val request =
          Request.Builder()
            .url("http://square.com/")
            .header("TE", "trailers")
            .build()
        val expected =
          headerEntries(
            ":method",
            "GET",
            ":path",
            "/",
            ":scheme",
            "http",
            "te",
            "trailers",
          )
        assertThat(http2HeadersList(request)).isEqualTo(expected)
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

        val mockResponse =
          MockResponse.Builder()
            .socketPolicy(DoNotReadRequestBody(ErrorCode.NO_ERROR.httpCode))
            .trailers(headersOf("caboose", "xyz"))
    
        // Trailers always work for HTTP/2, but only for chunked bodies in HTTP/1.
        if (http2) {
          mockResponse.body("abc")
        } else {
          mockResponse.chunkedBody("abc", 1)
        }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  7. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/KotlinSourceModernTest.kt

        var trailers: Headers = mockResponse.trailers
        mockResponse = mockResponse.clearHeaders()
        mockResponse = mockResponse.addHeader("")
        mockResponse = mockResponse.addHeader("", "")
        mockResponse = mockResponse.addHeaderLenient("", Any())
        mockResponse = mockResponse.setHeader("", Any())
        mockResponse.headers = headersOf()
        mockResponse.trailers = headersOf()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  8. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/DeprecationBridge.kt

      for (pushPromise in pushPromises) {
        result.addPush(pushPromise.wrap())
      }
    
      result.settings(settings)
      result.status = status
      result.headers(headers)
      result.trailers(trailers)
      result.socketPolicy =
        when (socketPolicy) {
          SocketPolicy.EXPECT_CONTINUE, SocketPolicy.CONTINUE_ALWAYS -> {
            result.add100Continue()
            KeepOpen
          }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/http/ExchangeCodec.kt

      fun reportedContentLength(response: Response): Long
    
      @Throws(IOException::class)
      fun openResponseBodySource(response: Response): Source
    
      /** Returns the trailers after the HTTP response. May be empty. */
      @Throws(IOException::class)
      fun trailers(): Headers
    
      /**
       * Cancel this stream. Resources held by this stream will be cleaned up, though not synchronously.
       * That may happen later by the connection pool thread.
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3K bytes
    - Viewed (0)
  10. mockwebserver/src/main/kotlin/mockwebserver3/SocketPolicy.kt

      /**
       * Process the response without even attempting to reading the request body. For HTTP/2 this will
       * send [http2ErrorCode] after the response body or trailers. For HTTP/1 this will close the
       * socket after the response body or trailers.
       */
      class DoNotReadRequestBody(
        val http2ErrorCode: Int = 0,
      ) : SocketPolicy
    
      /** Don't trust the client during the SSL handshake. */
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 23 14:31:42 UTC 2024
    - 4.6K bytes
    - Viewed (0)
Back to top