Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for readRequests (0.13 sec)

  1. src/net/http/request.go

    	textprotoReaderPool.Put(r)
    }
    
    // ReadRequest reads and parses an incoming request from b.
    //
    // ReadRequest is a low-level function and should only be used for
    // specialized applications; most code should use the [Server] to read
    // requests and handle them via the [Handler] interface. ReadRequest
    // only supports HTTP/1.x requests. For HTTP/2, use golang.org/x/net/http2.
    func ReadRequest(b *bufio.Reader) (*Request, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 49.4K bytes
    - Viewed (0)
  2. src/net/http/fs_test.go

    		{"/../", 400},
    		{"/../foo", 400},
    		{"/..\\foo", 400},
    		{"/file/a", 200},
    		{"/file/a..", 200},
    		{"/file/a/..", 400},
    		{"/file/a\\..", 400},
    	}
    	for _, tt := range tests {
    		req, err := ReadRequest(bufio.NewReader(strings.NewReader("GET " + tt.req + " HTTP/1.1\r\nHost: foo\r\n\r\n")))
    		if err != nil {
    			t.Errorf("bad request %q: %v", tt.req, err)
    			continue
    		}
    		rec := httptest.NewRecorder()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 23:39:44 UTC 2024
    - 49.9K bytes
    - Viewed (0)
  3. src/net/http/httputil/reverseproxy_test.go

    		//    use of closed network connection
    		t.Error("Server.Client().Do() returned nil error; want non-nil error")
    	}
    }
    
    func req(t *testing.T, v string) *http.Request {
    	req, err := http.ReadRequest(bufio.NewReader(strings.NewReader(v)))
    	if err != nil {
    		t.Fatal(err)
    	}
    	return req
    }
    
    // Issue 12344
    func TestNilBody(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 54.6K bytes
    - Viewed (0)
  4. src/net/url/url_test.go

    			RawQuery: "a=b",
    		},
    		"",
    	},
    	// Three leading slashes isn't an authority, but doesn't return an error.
    	// (We can't return an error, as this code is also used via
    	// ServeHTTP -> ReadRequest -> Parse, which is arguably a
    	// different URL parsing context, but currently shares the
    	// same codepath)
    	{
    		"///threeslashes",
    		&URL{
    			Path: "///threeslashes",
    		},
    		"",
    	},
    	{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:52:38 UTC 2024
    - 52.1K bytes
    - Viewed (0)
Back to top