Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 63 for wroteHeader (0.14 sec)

  1. 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)
  2. pkg/ctrlz/home.go

    				w.Header().Set("Content-Type", mime)
    			}
    			_, _ = w.Write(a)
    		} else {
    			// 'not found' page
    			w.WriteHeader(http.StatusNotFound)
    			fw.RenderHTML(w, errorTmpl, nil)
    		}
    	})
    
    	_ = router.NewRoute().Methods("PUT").Path("/homej/exit").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		w.WriteHeader(http.StatusAccepted)
    		time.AfterFunc(1*time.Second, func() {
    			os.Exit(0)
    		})
    	})
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. pkg/wasm/httpfetcher_test.go

    				if num <= 2 {
    					w.WriteHeader(http.StatusInternalServerError)
    				} else {
    					fmt.Fprintln(w, "wasm")
    				}
    			},
    			timeout:        5 * time.Second,
    			wantNumRequest: 4,
    		},
    		{
    			name: "download max retry",
    			handler: func(w http.ResponseWriter, r *http.Request, num int) {
    				w.WriteHeader(http.StatusInternalServerError)
    			},
    			timeout:        5 * time.Second,
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 15:56:41 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  6. 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)
  7. pkg/test/fakes/imageregistry/main.go

    			if err != nil {
    				http.Error(w, err.Error(), http.StatusBadRequest)
    				return
    			}
    			h.tagMap = m
    			w.WriteHeader(http.StatusOK)
    		case http.MethodGet:
    			if jsEncodedMap, err := json.Marshal(h.tagMap); err == nil {
    				w.Header().Set("Content-Type", "application/json")
    				w.WriteHeader(http.StatusOK)
    				fmt.Fprintf(w, "%s", jsEncodedMap)
    			} else {
    				http.Error(w, err.Error(), http.StatusInternalServerError)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/server/httplog/httplog.go

    	if !rl.statusRecorded {
    		rl.recordStatus(http.StatusOK) // Default if WriteHeader hasn't been called
    	}
    	if rl.captureErrorOutput {
    		rl.Addf("logging error output: %q\n", string(b))
    	}
    	return rl.w.Write(b)
    }
    
    // WriteHeader implements http.ResponseWriter.
    func (rl *respLogger) WriteHeader(status int) {
    	rl.recordStatus(status)
    	rl.w.WriteHeader(status)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Aug 07 10:10:35 UTC 2023
    - 9.7K 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