- Sort Score
- Result 10 results
- Languages All
Results 61 - 70 of 73 for wroteHeader (0.15 sec)
-
staging/src/k8s.io/apiserver/pkg/server/filters/cors.go
w.Header().Set("Access-Control-Allow-Credentials", allowCredentials) // Stop here if its a preflight OPTIONS request if req.Method == "OPTIONS" { w.WriteHeader(http.StatusNoContent) return } // Dispatch to the next handler handler.ServeHTTP(w, req) }) } // isOriginAllowed returns true if the given origin header in the // request is allowed CORS.
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Dec 15 13:59:10 UTC 2022 - 4.6K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/util/httpstream/httpstream_test.go
func newResponseWriter() *responseWriter { return &responseWriter{ header: make(http.Header), } } func (r *responseWriter) Header() http.Header { return r.header } func (r *responseWriter) WriteHeader(code int) { r.statusCode = &code } func (r *responseWriter) Write([]byte) (int, error) { return 0, nil } func TestHandshake(t *testing.T) { tests := map[string]struct { clientProtocols []string
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Oct 23 22:33:38 UTC 2023 - 4.5K bytes - Viewed (0) -
internal/s3select/select_benchmark_test.go
func (w *nullResponseWriter) Header() http.Header { return nil } func (w *nullResponseWriter) Write(p []byte) (int, error) { return len(p), nil } func (w *nullResponseWriter) WriteHeader(statusCode int) { } func (w *nullResponseWriter) Flush() { } func benchmarkSelect(b *testing.B, count int, query string) { requestXML := []byte(` <?xml version="1.0" encoding="UTF-8"?>
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Thu Apr 14 13:54:47 UTC 2022 - 5K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/testing/webhook_server.go
// fmt.Printf("got req: %v\n", r.URL.Path) switch r.URL.Path { case "/internalErr": http.Error(w, "webhook internal server error", http.StatusInternalServerError) return case "/invalidReq": w.WriteHeader(http.StatusSwitchingProtocols) w.Write([]byte("webhook invalid request")) return case "/invalidResp": w.Header().Set("Content-Type", "application/json") w.Write([]byte("webhook invalid response"))
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Nov 15 11:11:25 UTC 2021 - 6.3K bytes - Viewed (0) -
cmd/generic-handlers_test.go
func TestSSETLSHandler(t *testing.T) { defer func(isSSL bool) { globalIsTLS = isSSL }(globalIsTLS) // reset globalIsTLS after test var okHandler http.HandlerFunc = func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) } for i, test := range sseTLSHandlerTests { globalIsTLS = test.IsTLS w := httptest.NewRecorder() r := new(http.Request) r.Header = test.Header r.URL = test.URL
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Thu Mar 28 17:44:56 UTC 2024 - 5.4K bytes - Viewed (0) -
internal/handlers/forwarder.go
// `http: proxy error: context canceled` printed by Golang func (f *Forwarder) customErrHandler(w http.ResponseWriter, r *http.Request, err error) { if f.Logger != nil && err != context.Canceled { f.Logger(err) } w.WriteHeader(http.StatusBadGateway) } func (f *Forwarder) getURLFromRequest(req *http.Request) *url.URL { // If the Request was created by Go via a real HTTP request, RequestURI will
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Fri Apr 07 05:42:10 UTC 2023 - 5.6K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/server/httplog/httplog_test.go
if logger.status != http.StatusOK { t.Errorf("expected status after write to be %v, got %v", http.StatusOK, logger.status) } tw = new(responsewriter.FakeResponseWriter) logger = newLogged(req, tw) logger.WriteHeader(http.StatusForbidden) logger.Write(nil) if logger.status != http.StatusForbidden { t.Errorf("expected status after write to remain %v, got %v", http.StatusForbidden, logger.status) } }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Oct 05 18:05:09 UTC 2021 - 6.2K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/server/graceful_shutdown_test.go
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Jun 29 15:48:39 UTC 2023 - 6.9K bytes - Viewed (0) -
src/net/http/transport_dial_test.go
} dt.cst = newClientServerTest(t, mode, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Write response headers when we receive a request. http.NewResponseController(w).EnableFullDuplex() w.WriteHeader(200) http.NewResponseController(w).Flush() // Wait for the client to send the request body, // to synchronize with the rest of the test. io.ReadAll(r.Body) }), func(tr *http.Transport) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 17 21:11:57 UTC 2024 - 6.3K bytes - Viewed (0) -
internal/http/server.go
// To indicate disable keep-alive, server is shutting down. w.Header().Set("Connection", "close") // Add 1 minute retry header, incase-client wants to honor it w.Header().Set(RetryAfter, "60") w.WriteHeader(http.StatusServiceUnavailable) w.Write([]byte(http.ErrServerClosed.Error())) return } atomic.AddInt32(&srv.requestCount, 1) defer atomic.AddInt32(&srv.requestCount, -1)
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Fri Feb 09 21:25:16 UTC 2024 - 7.7K bytes - Viewed (0)