Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for wroteHeader (0.29 sec)

  1. src/net/http/httputil/reverseproxy_test.go

    type testResponseWriter struct {
    	h           http.Header
    	writeHeader func(int)
    	write       func([]byte) (int, error)
    }
    
    func (rw *testResponseWriter) Header() http.Header {
    	if rw.h == nil {
    		rw.h = make(http.Header)
    	}
    	return rw.h
    }
    
    func (rw *testResponseWriter) WriteHeader(statusCode int) {
    	if rw.writeHeader != nil {
    		rw.writeHeader(statusCode)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 54.6K bytes
    - Viewed (0)
  2. src/net/http/client_test.go

    		case "/final":
    			if r.Host != tsHost {
    				t.Errorf("Serving /final: Request.Host = %#v; want %#v", r.Host, tsHost)
    				w.WriteHeader(404)
    				return
    			}
    			w.WriteHeader(200)
    			io.WriteString(w, wantBody)
    		default:
    			t.Errorf("Serving unexpected path %q", r.URL.Path)
    			w.WriteHeader(404)
    		}
    	})).ts
    	tsURL = ts.URL
    	tsHost = strings.TrimPrefix(ts.URL, "http://")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:30:50 UTC 2024
    - 63.8K bytes
    - Viewed (0)
  3. src/net/http/request.go

    		if err != nil {
    			return err
    		}
    	}
    
    	_, err = io.WriteString(w, "\r\n")
    	if err != nil {
    		return err
    	}
    
    	if trace != nil && trace.WroteHeaders != nil {
    		trace.WroteHeaders()
    	}
    
    	// Flush and wait for 100-continue if expected.
    	if waitForContinue != nil {
    		if bw, ok := w.(*bufio.Writer); ok {
    			err = bw.Flush()
    			if err != nil {
    				return err
    			}
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 49.4K bytes
    - Viewed (0)
  4. staging/src/k8s.io/cli-runtime/pkg/resource/builder_test.go

    			}
    		}
    	}
    }
    
    func TestNamespaceOverride(t *testing.T) {
    	s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		w.WriteHeader(http.StatusOK)
    		w.Write([]byte(runtime.EncodeOrDie(corev1Codec, &v1.Pod{ObjectMeta: metav1.ObjectMeta{Namespace: "foo", Name: "test"}})))
    	}))
    	defer s.Close()
    
    	b := newDefaultBuilder().
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 11:58:41 UTC 2023
    - 56.1K bytes
    - Viewed (0)
  5. pkg/controller/endpoint/endpoints_controller_test.go

    	handlerFunc := func(res http.ResponseWriter, req *http.Request) {
    		if controller == nil {
    			res.WriteHeader(http.StatusInternalServerError)
    			res.Write([]byte("controller has not been set yet"))
    			return
    		}
    
    		if req.Method == "POST" {
    			controller.endpointsStore.Add(endpoint)
    			blockNextAction <- struct{}{}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 26 06:51:56 UTC 2024
    - 87.7K bytes
    - Viewed (0)
  6. pkg/kubelet/server/server_test.go

    	content := string(`<pre><a href="kubelet.log">kubelet.log</a><a href="google.log">google.log</a></pre>`)
    
    	fw.fakeKubelet.logFunc = func(w http.ResponseWriter, req *http.Request) {
    		w.WriteHeader(http.StatusOK)
    		w.Header().Add("Content-Type", "text/html")
    		w.Write([]byte(content))
    	}
    
    	resp, err := http.Get(fw.testHTTPServer.URL + "/logs/")
    	if err != nil {
    		t.Fatalf("Got error GETing: %v", err)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 51.5K bytes
    - Viewed (0)
  7. cmd/peer-rest-server.go

    			out <- grid.NewBytesWithCopyOf(buf.Bytes())
    		case <-ctx.Done():
    			return grid.NewRemoteErr(ctx.Err())
    		}
    	}
    }
    
    func (s *peerRESTServer) writeErrorResponse(w http.ResponseWriter, err error) {
    	w.WriteHeader(http.StatusForbidden)
    	w.Write([]byte(err.Error()))
    }
    
    // IsValid - To authenticate and verify the time difference.
    func (s *peerRESTServer) IsValid(w http.ResponseWriter, r *http.Request) bool {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 52.1K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go

    			headerMatcher.inspect(t, w, fsName, plName)
    
    			if r.URL.Path == rquestTimesOutPath {
    
    				// inner handler writes header and then let the request time out.
    				w.WriteHeader(http.StatusBadRequest)
    				<-callerRoundTripDoneCh
    
    				// we expect the timeout handler to have timed out this request by now and any attempt
    				// to write to the response should return a http.ErrHandlerTimeout error.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 30 12:18:40 UTC 2023
    - 52.6K bytes
    - Viewed (0)
  9. internal/s3select/select_test.go

    	return nil
    }
    
    func (w *testResponseWriter) Write(p []byte) (int, error) {
    	w.response = append(w.response, p...)
    	return len(p), nil
    }
    
    func (w *testResponseWriter) WriteHeader(statusCode int) {
    	w.statusCode = statusCode
    }
    
    func (w *testResponseWriter) Flush() {
    }
    
    func TestJSONQueries(t *testing.T) {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sat Dec 23 07:19:11 UTC 2023
    - 76.2K bytes
    - Viewed (0)
Back to top