Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for ProtoMinor (0.13 sec)

  1. src/net/http/responsewrite_test.go

    	Raw  string
    }
    
    func TestResponseWrite(t *testing.T) {
    	respWriteTests := []respWriteTest{
    		// HTTP/1.0, identity coding; no trailer
    		{
    			Response{
    				StatusCode:    503,
    				ProtoMajor:    1,
    				ProtoMinor:    0,
    				Request:       dummyReq("GET"),
    				Header:        Header{},
    				Body:          io.NopCloser(strings.NewReader("abcdef")),
    				ContentLength: 6,
    			},
    
    			"HTTP/1.0 503 Service Unavailable\r\n" +
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 01:07:32 UTC 2022
    - 6.9K bytes
    - Viewed (0)
  2. src/net/http/httptest/httptest_test.go

    	want := &http.Request{
    		Method:     "GET",
    		Host:       "example.com",
    		URL:        &url.URL{Path: "/"},
    		Header:     http.Header{},
    		Proto:      "HTTP/1.1",
    		ProtoMajor: 1,
    		ProtoMinor: 1,
    		RemoteAddr: "192.0.2.1:1234",
    		RequestURI: "/",
    	}
    	got.Body = nil // before DeepEqual
    	want = want.WithContext(context.Background())
    	if !reflect.DeepEqual(got, want) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 11 18:09:14 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  3. src/net/http/alpn_test.go

    	}
    	line = strings.TrimSpace(line)
    	path := strings.TrimPrefix(line, "GET ")
    	if path == line {
    		return
    	}
    	req, _ := NewRequest("GET", path, nil)
    	req.Proto = "HTTP/0.9"
    	req.ProtoMajor = 0
    	req.ProtoMinor = 9
    	rw := &http09Writer{conn, make(Header)}
    	h.ServeHTTP(rw, req)
    }
    
    type http09Writer struct {
    	io.Writer
    	h Header
    }
    
    func (w http09Writer) Header() Header  { return w.h }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 3K bytes
    - Viewed (0)
  4. src/net/http/httptest/httptest.go

    	if err != nil {
    		panic("invalid NewRequest arguments; " + err.Error())
    	}
    	req = req.WithContext(ctx)
    
    	// HTTP/1.0 was used above to avoid needing a Host field. Change it to 1.1 here.
    	req.Proto = "HTTP/1.1"
    	req.ProtoMinor = 1
    	req.Close = false
    
    	if body != nil {
    		switch v := body.(type) {
    		case *bytes.Buffer:
    			req.ContentLength = int64(v.Len())
    		case *bytes.Reader:
    			req.ContentLength = int64(v.Len())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 11 18:09:14 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  5. internal/handlers/forwarder.go

    	// Do not pass client Host header unless requested.
    	if !f.PassHost {
    		outReq.Host = target.Host
    	}
    
    	// TODO: only supports HTTP 1.1 for now.
    	outReq.Proto = "HTTP/1.1"
    	outReq.ProtoMajor = 1
    	outReq.ProtoMinor = 1
    
    	f.rewriter.Rewrite(outReq)
    
    	// Disable closeNotify when method GET for http pipelining
    	if outReq.Method == http.MethodGet {
    		quietReq := outReq.WithContext(context.Background())
    		*outReq = *quietReq
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Apr 07 05:42:10 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  6. src/net/http/cgi/child.go

    	r.Method = params["REQUEST_METHOD"]
    	if r.Method == "" {
    		return nil, errors.New("cgi: no REQUEST_METHOD in environment")
    	}
    
    	r.Proto = params["SERVER_PROTOCOL"]
    	var ok bool
    	r.ProtoMajor, r.ProtoMinor, ok = http.ParseHTTPVersion(r.Proto)
    	if !ok {
    		return nil, errors.New("cgi: invalid SERVER_PROTOCOL version")
    	}
    
    	r.Close = true
    	r.Trailer = http.Header{}
    	r.Header = http.Header{}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  7. src/net/http/httptest/recorder.go

    	if rw.result != nil {
    		return rw.result
    	}
    	if rw.snapHeader == nil {
    		rw.snapHeader = rw.HeaderMap.Clone()
    	}
    	res := &http.Response{
    		Proto:      "HTTP/1.1",
    		ProtoMajor: 1,
    		ProtoMinor: 1,
    		StatusCode: rw.Code,
    		Header:     rw.snapHeader,
    	}
    	rw.result = res
    	if res.StatusCode == 0 {
    		res.StatusCode = 200
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 7K bytes
    - Viewed (0)
  8. src/net/http/transfer_test.go

    		},
    		{
    			hdr:     Header{"Transfer-Encoding": {"chunked"}},
    			wantErr: nil,
    		},
    	}
    
    	for i, tt := range tests {
    		tr := &transferReader{
    			Header:     tt.hdr,
    			ProtoMajor: 1,
    			ProtoMinor: 1,
    		}
    		gotErr := tr.parseTransferEncoding()
    		if !reflect.DeepEqual(gotErr, tt.wantErr) {
    			t.Errorf("%d.\ngot error:\n%v\nwant error:\n%v\n\n", i, gotErr, tt.wantErr)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:16:28 UTC 2023
    - 9.1K bytes
    - Viewed (0)
  9. src/net/http/httputil/dump.go

    	reqURI := req.RequestURI
    	if reqURI == "" {
    		reqURI = req.URL.RequestURI()
    	}
    
    	fmt.Fprintf(&b, "%s %s HTTP/%d.%d\r\n", valueOrDefault(req.Method, "GET"),
    		reqURI, req.ProtoMajor, req.ProtoMinor)
    
    	absRequestURI := strings.HasPrefix(req.RequestURI, "http://") || strings.HasPrefix(req.RequestURI, "https://")
    	if !absRequestURI {
    		host := req.Host
    		if host == "" && req.URL != nil {
    			host = req.URL.Host
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 9.3K bytes
    - Viewed (0)
Back to top