Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. staging/src/k8s.io/apiserver/pkg/server/filters/goaway_test.go

    	})
    	postHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    		reqBody, err := ioutil.ReadAll(r.Body)
    		if err != nil {
    			http.Error(w, err.Error(), http.StatusInternalServerError)
    			return
    		}
    		if !reflect.DeepEqual(requestPostBody, reqBody) {
    			http.Error(w, fmt.Sprintf("expect request body: %s, got: %s", requestPostBody, reqBody), http.StatusBadRequest)
    			return
    		}
    
    		w.WriteHeader(http.StatusOK)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 17 12:58:54 UTC 2021
    - 13.9K bytes
    - Viewed (0)
  2. src/net/http/transport_dial_test.go

    type transportDialTesterRoundTrip struct {
    	t *testing.T
    
    	roundTripID int                // distinguishes RoundTrips in logs
    	cancel      context.CancelFunc // cancels the Request context
    	reqBody     io.WriteCloser     // write half of the Request.Body
    	finished    bool
    
    	done chan struct{} // closed when RoundTrip returns:w
    	res  *http.Response
    	err  error
    	conn *transportDialTesterConn
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 21:11:57 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware_test.go

    	}
    
    	sampleData := []byte("abcde")
    
    	table := map[string]struct {
    		reqHeaders http.Header
    		reqBody    []byte
    
    		expectedHeaders http.Header
    		expectedBody    []byte
    	}{
    		"content-length": {
    			reqHeaders: http.Header{
    				"Content-Length": []string{"5"},
    			},
    			reqBody: sampleData,
    
    			expectedHeaders: http.Header{
    				"Content-Length":    []string{"5"},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 10 07:29:34 UTC 2023
    - 39.4K bytes
    - Viewed (0)
  4. src/net/http/clientserver_test.go

    	const reqBody = "some request body"
    	const resBody = "some response body"
    	cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
    		var wg sync.WaitGroup
    		wg.Add(2)
    		didRead := make(chan bool, 1)
    		// Read in one goroutine.
    		go func() {
    			defer wg.Done()
    			data, err := io.ReadAll(r.Body)
    			if string(data) != reqBody {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 46.6K bytes
    - Viewed (0)
  5. src/net/http/serve_test.go

    			wg.Add(1)
    			body := &wgReadCloser{
    				Reader: strings.NewReader(body),
    				wg:     &wg,
    			}
    			return body, nil
    		}
    		reqBody, _ := getBody()
    		req, err := NewRequest("POST", ts.URL, reqBody)
    		if err != nil {
    			reqBody.Close()
    			t.Fatal(err)
    		}
    		req.ContentLength = int64(len(body))
    		req.GetBody = getBody
    		req.Header.Set("Content-Type", "text/plain")
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 202K bytes
    - Viewed (0)
  6. src/net/http/server.go

    		}
    
    		if discard {
    			_, err := io.CopyN(io.Discard, w.reqBody, maxPostHandlerReadBytes+1)
    			switch err {
    			case nil:
    				// There must be even more data left over.
    				tooBig = true
    			case ErrBodyReadAfterClose:
    				// Body was already consumed and closed.
    			case io.EOF:
    				// The remaining body was just consumed, close it.
    				err = w.reqBody.Close()
    				if err != nil {
    					w.closeAfterReply = true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 123.4K bytes
    - Viewed (0)
  7. src/net/http/transport_test.go

    				Reader: strings.NewReader(bigBody),
    				wg:     &wg,
    			}
    			return body, nil
    		}
    
    		for i := 0; i < count; i++ {
    			reqBody, _ := getBody()
    			req, err := NewRequest("PUT", ts.URL, reqBody)
    			if err != nil {
    				reqBody.Close()
    				t.Fatal(err)
    			}
    			req.ContentLength = int64(len(bigBody))
    			req.GetBody = getBody
    
    			resp, err := c.Do(req)
    			if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 21:59:21 UTC 2024
    - 192.6K bytes
    - Viewed (0)
  8. src/net/http/h2_bundle.go

    	// while still writing request body
    	cc.mu.Lock()
    	mustCloseBody := false
    	if cs.reqBody != nil && cs.reqBodyClosed == nil {
    		mustCloseBody = true
    		cs.reqBodyClosed = make(chan struct{})
    	}
    	bodyClosed := cs.reqBodyClosed
    	cc.mu.Unlock()
    	if mustCloseBody {
    		cs.reqBody.Close()
    		close(bodyClosed)
    	}
    	if bodyClosed != nil {
    		<-bodyClosed
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 364.1K bytes
    - Viewed (0)
  9. tests/integration/security/fuzz/fuzzers/jwt_tool/jwtconf.ini

    sigType =
    targetUrl =
    cookies =
    key =
    keyList =
    keyFile =
    headerLoc =
    payloadclaim =
    headerclaim =
    payloadvalue =
    headervalue =
    canaryvalue =
    header =
    exploitType =
    scanMode =
    reqMode =
    postData =
    resCode =
    resSize =
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 21 20:06:01 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  10. src/net/http/request_test.go

    func TestWithContextNilURL(t *testing.T) {
    	req, err := NewRequest("POST", "https://golang.org/", nil)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	// Issue 20601
    	req.URL = nil
    	reqCopy := req.WithContext(context.Background())
    	if reqCopy.URL != nil {
    		t.Error("expected nil URL in cloned request")
    	}
    }
    
    // Ensure that Request.Clone creates a deep copy of TransferEncoding.
    // See issue 41907.
    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