Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 63 for wroteHeader (0.13 sec)

  1. docs/iam/identity-manager-plugin.go

    	if token == "" {
    		writeErrorResponse(w, errors.New("token parameter not given"))
    		return
    	}
    
    	rsp, ok := tokens[token]
    	if !ok {
    		w.WriteHeader(http.StatusForbidden)
    		return
    	}
    
    	fmt.Printf("Allowed for token: %s user: %s\n", token, rsp.User)
    
    	w.WriteHeader(http.StatusOK)
    	json.NewEncoder(w).Encode(rsp)
    	return
    }
    
    func main() {
    	http.HandleFunc("/", mainHandler)
    
    	log.Print("Listening on :8081")
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 01 21:31:13 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/util/net/testing/http.go

    		rw.WriteHeader(http.StatusInternalServerError)
    		return
    	}
    	defer sconn.Close()
    
    	hj, ok := rw.(http.Hijacker)
    	if !ok {
    		h.t.Logf("Can't switch protocols using non-Hijacker ResponseWriter: type=%T, host=%s", rw, req.Host)
    		rw.WriteHeader(http.StatusInternalServerError)
    		return
    	}
    
    	rw.WriteHeader(http.StatusOK)
    
    	conn, brw, err := hj.Hijack()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 20 14:58:46 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  3. src/cmd/dist/buildruntime.go

    )
    
    /*
     * Helpers for building runtime.
     */
    
    // mkzversion writes zversion.go:
    //
    //	package sys
    //
    // (Nothing right now!)
    func mkzversion(dir, file string) {
    	var buf strings.Builder
    	writeHeader(&buf)
    	fmt.Fprintf(&buf, "package sys\n")
    	writefile(buf.String(), file, writeSkipSame)
    }
    
    // mkbuildcfg writes internal/buildcfg/zbootstrap.go:
    //
    //	package buildcfg
    //
    //	const defaultGOROOT = <goroot>
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 06 01:33:19 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  4. internal/http/response-recorder.go

    	// ... otherwise we return the <BLOB> place holder
    	return blobBody
    }
    
    // WriteHeader - writes http status code
    func (lrw *ResponseRecorder) WriteHeader(code int) {
    	if !lrw.headersLogged {
    		lrw.StatusCode = code
    		lrw.writeHeaders(&lrw.headers, code, lrw.ResponseWriter.Header())
    		lrw.headersLogged = true
    		lrw.ResponseWriter.WriteHeader(code)
    	}
    }
    
    // Flush - Calls the underlying Flush.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sat Dec 02 00:13:19 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. pkg/hbone/server.go

    	defer cancel()
    
    	dst, err := (&net.Dialer{}).DialContext(ctx, "tcp", r.Host)
    	if err != nil {
    		w.WriteHeader(http.StatusServiceUnavailable)
    		log.Errorf("failed to dial upstream: %v", err)
    		return true
    	}
    	log.Infof("Connected to %v", r.Host)
    	w.WriteHeader(http.StatusOK)
    
    	wg := sync.WaitGroup{}
    	wg.Add(1)
    	go func() {
    		// downstream (hbone client) <-- upstream (app)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Nov 10 02:05:07 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. staging/src/k8s.io/apiserver/pkg/endpoints/filters/audit.go

    }
    
    func (a *auditResponseWriter) Write(bs []byte) (int, error) {
    	// the Go library calls WriteHeader internally if no code was written yet. But this will go unnoticed for us
    	a.processCode(http.StatusOK)
    	return a.ResponseWriter.Write(bs)
    }
    
    func (a *auditResponseWriter) WriteHeader(code int) {
    	a.processCode(code)
    	a.ResponseWriter.WriteHeader(code)
    }
    
    func (a *auditResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 8.6K bytes
    - Viewed (0)
Back to top