Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for TransferEncoding (0.22 sec)

  1. src/net/http/transfer_test.go

    			}
    			defer cleanup()
    
    			mw := &mockTransferWriter{}
    			tw := &transferWriter{
    				Body:             body,
    				ContentLength:    tc.contentLength,
    				TransferEncoding: tc.transferEncoding,
    			}
    
    			if err := tw.writeBody(mw); err != nil {
    				t.Fatal(err)
    			}
    
    			if tc.expectedReader != nil {
    				if mw.CalledReader == nil {
    					t.Fatal("did not call ReadFrom")
    				}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:16:28 UTC 2023
    - 9.1K bytes
    - Viewed (0)
  2. src/net/http/transfer.go

    		}
    		t.Method = valueOrDefault(rr.Method, "GET")
    		t.Close = rr.Close
    		t.TransferEncoding = rr.TransferEncoding
    		t.Header = rr.Header
    		t.Trailer = rr.Trailer
    		t.Body = rr.Body
    		t.BodyCloser = rr.Body
    		t.ContentLength = rr.outgoingLength()
    		if t.ContentLength < 0 && len(t.TransferEncoding) == 0 && t.shouldSendChunkedRequestBody() {
    			t.TransferEncoding = []string{"chunked"}
    		}
    		// If there's a body, conservatively flush the headers
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 22:14:00 UTC 2024
    - 31.1K bytes
    - Viewed (0)
  3. src/net/http/responsewrite_test.go

    				ProtoMajor:       1,
    				ProtoMinor:       1,
    				Request:          dummyReq11("GET"),
    				Header:           Header{},
    				Body:             io.NopCloser(strings.NewReader("abcdef")),
    				ContentLength:    -1,
    				TransferEncoding: []string{"chunked"},
    				Close:            false,
    			},
    			"HTTP/1.1 200 OK\r\n" +
    				"Transfer-Encoding: chunked\r\n\r\n" +
    				"6\r\nabcdef\r\n0\r\n\r\n",
    		},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 01:07:32 UTC 2022
    - 6.9K bytes
    - Viewed (0)
  4. src/net/http/response.go

    	// be semantically equivalent to a comma-delimited sequence.) When
    	// Header values are duplicated by other fields in this struct (e.g.,
    	// ContentLength, TransferEncoding, Trailer), the field values are
    	// authoritative.
    	//
    	// Keys in the map are canonicalized (see CanonicalHeaderKey).
    	Header Header
    
    	// Body represents the response body.
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  5. src/net/http/response_test.go

    			ProtoMinor:       1,
    			Request:          dummyReq("GET"),
    			Header:           Header{},
    			Close:            false,
    			ContentLength:    -1,
    			TransferEncoding: []string{"chunked"},
    		},
    
    		"Body here\ncontinued",
    	},
    
    	// Trailer header but no TransferEncoding
    	{
    		"HTTP/1.0 200 OK\r\n" +
    			"Trailer: Content-MD5, Content-Sources\r\n" +
    			"Content-Length: 10\r\n" +
    			"Connection: close\r\n" +
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 19:01:29 UTC 2024
    - 23.6K bytes
    - Viewed (0)
  6. src/net/http/httputil/dump.go

    			host = req.URL.Host
    		}
    		if host != "" {
    			fmt.Fprintf(&b, "Host: %s\r\n", host)
    		}
    	}
    
    	chunked := len(req.TransferEncoding) > 0 && req.TransferEncoding[0] == "chunked"
    	if len(req.TransferEncoding) > 0 {
    		fmt.Fprintf(&b, "Transfer-Encoding: %s\r\n", strings.Join(req.TransferEncoding, ","))
    	}
    
    	err = req.Header.WriteSubset(&b, reqWriteExcludeHeaderDump)
    	if err != nil {
    		return nil, err
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  7. cmd/http-tracer.go

    		}
    
    		// Calculate input body size with headers
    		reqHeaders := r.Header.Clone()
    		reqHeaders.Set("Host", r.Host)
    		if len(r.TransferEncoding) == 0 {
    			reqHeaders.Set("Content-Length", strconv.Itoa(int(r.ContentLength)))
    		} else {
    			reqHeaders.Set("Transfer-Encoding", strings.Join(r.TransferEncoding, ","))
    		}
    		inputBytes := reqRecorder.Size()
    		for k, v := range reqHeaders {
    			inputBytes += len(k) + len(v)
    		}
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 03 15:45:54 UTC 2024
    - 6K bytes
    - Viewed (0)
  8. src/net/http/readrequest_test.go

    			"3\r\nfoo\r\n" +
    			"3\r\nbar\r\n" +
    			"0\r\n" +
    			"Trailer-Key: Trailer-Value\r\n" +
    			"\r\n",
    		&Request{
    			Method: "POST",
    			URL: &url.URL{
    				Path: "/",
    			},
    			TransferEncoding: []string{"chunked"},
    			Proto:            "HTTP/1.1",
    			ProtoMajor:       1,
    			ProtoMinor:       1,
    			Header:           Header{},
    			ContentLength:    -1,
    			Host:             "foo.com",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 14 22:23:32 UTC 2024
    - 10K bytes
    - Viewed (0)
  9. src/net/http/cgi/host.go

    					break
    				}
    			}
    		}
    		if !found {
    			ret = append(ret, e)
    		}
    	}
    	return
    }
    
    func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
    	if len(req.TransferEncoding) > 0 && req.TransferEncoding[0] == "chunked" {
    		rw.WriteHeader(http.StatusBadRequest)
    		rw.Write([]byte("Chunked request bodies are not supported by CGI."))
    		return
    	}
    
    	root := strings.TrimRight(h.Root, "/")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 20:46:32 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  10. src/net/http/request_test.go

    	req.TransferEncoding[0] = "encoding2"
    
    	if req.TransferEncoding[0] != "encoding2" {
    		t.Error("expected req.TransferEncoding to be changed")
    	}
    	if clonedReq.TransferEncoding[0] != "encoding1" {
    		t.Error("expected clonedReq.TransferEncoding to be unchanged")
    	}
    }
    
    // Ensure that Request.Clone works correctly with PathValue.
    // See issue 64911.
    func TestRequestClonePathValue(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 18:42:34 UTC 2024
    - 44K bytes
    - Viewed (0)
Back to top