Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 36 for wroteHeader (0.21 sec)

  1. pilot/pkg/request/command_test.go

    			if err := util.Compare(body, p.States[0].wantBody); err == nil {
    				w.WriteHeader(p.States[0].StatusCode)
    				w.Write([]byte(p.States[0].Response))
    			} else {
    				w.WriteHeader(http.StatusBadRequest)
    				w.Write([]byte(fmt.Sprintf("wanted body %q got %q", string(p.States[0].wantBody), string(body))))
    			}
    		} else {
    			w.WriteHeader(http.StatusBadRequest)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Dec 11 19:11:01 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  2. src/internal/trace/version/version.go

    	}
    	if !v.Valid() {
    		return v, fmt.Errorf("unknown or unsupported trace version go 1.%d", v)
    	}
    	return v, nil
    }
    
    // WriteHeader writes a header for a trace version v to w.
    func WriteHeader(w io.Writer, v Version) (int, error) {
    	return fmt.Fprintf(w, headerFmt, v)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  3. pkg/ctrlz/topics/signals.go

    		err := syscall.Kill(os.Getpid(), syscall.SIGUSR1)
    		if err != nil {
    			w.WriteHeader(http.StatusInternalServerError)
    			return
    		}
    		w.WriteHeader(http.StatusAccepted)
    	})
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Feb 07 17:12:24 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  4. cni/pkg/nodeagent/healthServer.go

    func healthz(w http.ResponseWriter, _ *http.Request) {
    	w.WriteHeader(http.StatusOK)
    }
    
    func readyz(installReady, watchReady *atomic.Value) http.HandlerFunc {
    	return func(w http.ResponseWriter, _ *http.Request) {
    		if !installReady.Load().(bool) || !watchReady.Load().(bool) {
    			http.Error(w, http.StatusText(http.StatusServiceUnavailable), http.StatusServiceUnavailable)
    			return
    		}
    		w.WriteHeader(http.StatusOK)
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Apr 15 01:29:35 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  5. cni/pkg/plugin/cnieventclient_test.go

    	// Fake out a test HTTP server and use that instead of a real HTTP server over gRPC to validate  req/resp flows
    	testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
    		res.WriteHeader(http.StatusOK)
    		res.Write([]byte("server happy"))
    	}))
    	defer func() { testServer.Close() }()
    
    	cniC := fakeCNIEventClient(testServer.URL)
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jan 26 20:34:28 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  6. docs/auditlog/auditlog-echo.go

    	defer r.Body.Close()
    	if err != nil {
    		log.Printf("Error reading request body: %v", err)
    		w.WriteHeader(http.StatusBadRequest)
    		return
    	}
    
    	log.Printf(">>> %s %s\n", r.Method, r.URL.Path)
    	var out bytes.Buffer
    	json.Indent(&out, body, "", "    ")
    	log.Printf("%s\n", out.String())
    
    	w.WriteHeader(http.StatusOK)
    }
    
    func main() {
    	flag.Parse()
    	http.HandleFunc("/", mainHandler)
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 01 21:31:13 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  7. pkg/proxy/healthcheck/proxier_health.go

    	resp.Header().Set("X-Content-Type-Options", "nosniff")
    	if !healthy {
    		metrics.ProxyHealthzTotal.WithLabelValues("503").Inc()
    		resp.WriteHeader(http.StatusServiceUnavailable)
    	} else {
    		metrics.ProxyHealthzTotal.WithLabelValues("200").Inc()
    		resp.WriteHeader(http.StatusOK)
    		// In older releases, the returned "lastUpdated" time indicated the last
    		// time the proxier sync loop ran, even if nothing had changed. To
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 16 10:41:18 UTC 2023
    - 8K bytes
    - Viewed (0)
  8. samples/jwt-server/src/main.go

    		if err != nil {
    			// Handle invalid delay parameter
    			response.WriteHeader(http.StatusBadRequest)
    			response.Write([]byte("Invalid delay parameter"))
    			return
    		}
    
    		// If delay parameter is provided and valid, add delay
    		if delayDuration > 0 {
    			time.Sleep(delayDuration)
    		}
    	}
    
    	response.WriteHeader(http.StatusOK)
    	response.Write([]byte(string(jwtKey)))
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 16 23:56:50 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  9. src/encoding/pem/pem.go

    		// See RFC 1421, section 4.6.1.1
    		if hasProcType {
    			if err := writeHeader(out, procType, b.Headers[procType]); err != nil {
    				return err
    			}
    		}
    		// For consistency of output, write other headers sorted by key.
    		slices.Sort(h)
    		for _, k := range h {
    			if err := writeHeader(out, k, b.Headers[k]); err != nil {
    				return err
    			}
    		}
    		if _, err := out.Write(nl); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  10. src/database/sql/example_service_test.go

    		defer cancel()
    
    		err := s.db.PingContext(ctx)
    		if err != nil {
    			http.Error(w, fmt.Sprintf("db down: %v", err), http.StatusFailedDependency)
    			return
    		}
    		w.WriteHeader(http.StatusOK)
    		return
    	case "/quick-action":
    		// This is a short SELECT. Use the request context as the base of
    		// the context timeout.
    		ctx, cancel := context.WithTimeout(r.Context(), 3*time.Second)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 28 20:21:26 UTC 2024
    - 4K bytes
    - Viewed (0)
Back to top