Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 167 for wroteHeader (0.66 sec)

  1. src/net/http/h2_bundle.go

    	// early. (We can't return an error from WriteHeader even if we wanted to.)
    	if code < 100 || code > 999 {
    		panic(fmt.Sprintf("invalid WriteHeader code %v", code))
    	}
    }
    
    func (w *http2responseWriter) WriteHeader(code int) {
    	rws := w.rws
    	if rws == nil {
    		panic("WriteHeader called after Handler finished")
    	}
    	rws.writeHeader(code)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 364.1K bytes
    - Viewed (0)
  2. src/cmd/dist/buildgo.go

    // and will not clean up properly.
    const generatedHeader = "// Code generated by go tool dist; DO NOT EDIT.\n\n"
    
    // writeHeader emits the standard "generated by" header for all files generated
    // by dist.
    func writeHeader(w io.Writer) {
    	fmt.Fprint(w, generatedHeader)
    }
    
    // mkzdefaultcc writes zdefaultcc.go:
    //
    //	package main
    //	const defaultCC = <defaultcc>
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 13 20:44:00 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  3. src/archive/tar/writer_test.go

    		}
    	})
    
    	t.Run("Persistence", func(t *testing.T) {
    		tw := NewWriter(new(failOnceWriter))
    		if err := tw.WriteHeader(&Header{}); err != io.ErrShortWrite {
    			t.Fatalf("WriteHeader() = %v, want %v", err, io.ErrShortWrite)
    		}
    		if err := tw.WriteHeader(&Header{Name: "small.txt"}); err == nil {
    			t.Errorf("WriteHeader() = got %v, want non-nil error", err)
    		}
    		if _, err := tw.Write(nil); err == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 38.7K bytes
    - Viewed (0)
  4. pkg/ctrlz/fw/utils.go

    		RenderError(w, http.StatusInternalServerError, err)
    		return
    	}
    
    	w.WriteHeader(http.StatusOK)
    	w.Header().Set("Content-Type", "text/html; charset=utf-8")
    	_, _ = b.WriteTo(w)
    }
    
    // RenderJSON outputs the given data as JSON
    func RenderJSON(w http.ResponseWriter, statusCode int, data any) {
    	w.WriteHeader(statusCode)
    	w.Header().Set("Content-Type", "application/json; charset=utf-8")
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  5. src/runtime/write_err_android.go

    		msg := []byte("runtime: cannot open /dev/log/main\x00")
    		write(2, unsafe.Pointer(&msg[0]), int32(len(msg)))
    		exit(2)
    	}
    
    	// Prepopulate the invariant header part.
    	copy(writeBuf[:len(writeHeader)], writeHeader)
    }
    
    // used in initLogdWrite but defined here to avoid heap allocation.
    var logdAddr sockaddr_un
    
    func initLogd() {
    	// In logd mode, logs are sent to the logd via a unix domain socket.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 18:23:49 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  6. src/net/http/cgi/host.go

    	sawBlankLine := false
    	for {
    		line, isPrefix, err := linebody.ReadLine()
    		if isPrefix {
    			rw.WriteHeader(http.StatusInternalServerError)
    			h.printf("cgi: long header line from subprocess.")
    			return
    		}
    		if err == io.EOF {
    			break
    		}
    		if err != nil {
    			rw.WriteHeader(http.StatusInternalServerError)
    			h.printf("cgi: error reading headers: %v", err)
    			return
    		}
    		if len(line) == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 20:46:32 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. pkg/bootstrap/platform/aws_test.go

    	}
    }
    
    func errorHandler(writer http.ResponseWriter, _ *http.Request) {
    	writer.WriteHeader(http.StatusInternalServerError)
    }
    
    func regionHandler(writer http.ResponseWriter, _ *http.Request) {
    	writer.WriteHeader(http.StatusOK)
    	writer.Write([]byte("us-west-2"))
    }
    
    func zoneHandler(writer http.ResponseWriter, _ *http.Request) {
    	writer.WriteHeader(http.StatusOK)
    	writer.Write([]byte("us-west-2b"))
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Mar 18 13:10:06 UTC 2022
    - 3.2K bytes
    - Viewed (0)
  10. 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)
Back to top