Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 63 for wroteHeader (0.16 sec)

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

    	w.Header().Set("Content-Type", runtime.ContentTypeJSON)
    	w.Header().Set("X-Content-Type-Options", "nosniff")
    	statusErr := apierrors.NewServiceUnavailable("apiserver is shutting down").Status()
    	w.WriteHeader(int(statusErr.Code))
    	fmt.Fprintln(w, runtime.EncodeOrDie(scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion), &statusErr))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jan 10 21:18:55 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  2. pkg/ctrlz/topics/scopes.go

    		if ok {
    			s.SetOutputLevel(level)
    		}
    
    		level, ok = stringToLevel[info.StackTraceLevel]
    		if ok {
    			s.SetStackTraceLevel(level)
    		}
    
    		s.SetLogCallers(info.LogCallers)
    		w.WriteHeader(http.StatusAccepted)
    		return
    	}
    
    	fw.RenderError(w, http.StatusBadRequest, fmt.Errorf("unknown scope name: %s", name))
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 4K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/server/filters/watch_termination_test.go

    				handlerInvokedGot++
    				if signal := apirequest.ServerShutdownSignalFrom(req.Context()); signal != nil {
    					signalGot, _ = signal.(*fakeServerShutdownSignal)
    				}
    				w.WriteHeader(http.StatusOK)
    			})
    
    			handler := WithWatchTerminationDuringShutdown(delegate, test.signal, test.wg)
    
    			req, err := http.NewRequest(http.MethodGet, "/apis/groups.k8s.io/v1/namespaces", nil)
    			if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 27 15:49:49 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. staging/src/k8s.io/apiserver/pkg/server/graceful_shutdown_test.go

    	handlerLock.Lock()
    	b.counter++
    	if b.counter == 25 {
    		startServerShutdown <- struct{}{}
    	}
    	handlerLock.Unlock()
    
    	time.Sleep(60 * time.Second)
    
    	w.Write([]byte("hello from the backend"))
    	w.WriteHeader(http.StatusOK)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 29 15:48:39 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top