Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 127 for remoteaddr (0.15 sec)

  1. 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)
  2. staging/src/k8s.io/apimachinery/pkg/util/net/http_test.go

    		realIP       string
    		forwardedFor string
    		remoteAddr   string
    		expected     []string
    	}{{
    		name:     "no headers, missing remoteAddr",
    		expected: []string{},
    	}, {
    		name:       "no headers, just remoteAddr host:port",
    		remoteAddr: "1.2.3.4:555",
    		expected:   []string{"1.2.3.4"},
    	}, {
    		name:       "no headers, just remoteAddr host",
    		remoteAddr: "1.2.3.4",
    		expected:   []string{"1.2.3.4"},
    	}, {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 18 01:21:56 UTC 2023
    - 24.5K bytes
    - Viewed (0)
  3. pkg/util/net/ip_test.go

    	testCases := []struct {
    		name       string
    		remoteAddr string
    		expected   bool
    	}{
    		{
    			name:       "Localhost IPv4",
    			remoteAddr: "127.0.0.1:8080",
    			expected:   true,
    		},
    		{
    			name:       "Localhost IPv6",
    			remoteAddr: "[::1]:8080",
    			expected:   true,
    		},
    		{
    			name:       "Private IPv4",
    			remoteAddr: "192.168.1.100:8080",
    			expected:   false,
    		},
    		{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 01 14:41:40 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  4. security/pkg/server/ca/authenticate/xfcc_authenticator.go

    	remoteAddr := ctx.RemoteAddress()
    	xfccHeader := ctx.Header(xfccparser.ForwardedClientCertHeader)
    	if len(remoteAddr) == 0 || len(xfccHeader) == 0 {
    		return nil, fmt.Errorf("caller from %s does not have Xfcc header", remoteAddr)
    	}
    	// First check if client is trusted client so that we can "trust" the Xfcc Header.
    	if !isTrustedAddress(remoteAddr, features.TrustedGatewayCIDR) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Apr 08 17:05:56 UTC 2024
    - 3K bytes
    - Viewed (0)
  5. src/net/http/cgi/host.go

    	}
    
    	if remoteIP, remotePort, err := net.SplitHostPort(req.RemoteAddr); err == nil {
    		env = append(env, "REMOTE_ADDR="+remoteIP, "REMOTE_HOST="+remoteIP, "REMOTE_PORT="+remotePort)
    	} else {
    		// could not parse ip:port, let's use whole RemoteAddr and leave REMOTE_PORT undefined
    		env = append(env, "REMOTE_ADDR="+req.RemoteAddr, "REMOTE_HOST="+req.RemoteAddr)
    	}
    
    	if hostDomain, _, err := net.SplitHostPort(req.Host); err == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 20:46:32 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/endpoints/discovery/addresses_test.go

    			},
    			ExpectedMap: publicAddressCIDRMap,
    		},
    
    		{
    			Request: http.Request{
    				RemoteAddr: internalIP,
    			},
    			ExpectedMap: internalAddressCIDRMap,
    		},
    		{
    			Request: http.Request{
    				RemoteAddr: publicIP,
    			},
    			ExpectedMap: publicAddressCIDRMap,
    		},
    		{
    			Request: http.Request{
    				RemoteAddr: "invalidIP",
    			},
    			ExpectedMap: publicAddressCIDRMap,
    		},
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Aug 20 08:42:09 UTC 2021
    - 2.7K bytes
    - Viewed (0)
  7. src/net/conn_test.go

    			if err != nil {
    				t.Fatal(err)
    			}
    			defer c.Close()
    			if c.LocalAddr().Network() != network || c.RemoteAddr().Network() != network {
    				t.Fatalf("got %s->%s; want %s->%s", c.LocalAddr().Network(), c.RemoteAddr().Network(), network, network)
    			}
    			c.SetDeadline(time.Now().Add(someTimeout))
    			c.SetReadDeadline(time.Now().Add(someTimeout))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  8. src/net/http/cgi/child_test.go

    		"REQUEST_METHOD":  "GET",
    		"REQUEST_URI":     "/path?a=b",
    		"CONTENT_LENGTH":  "123",
    		"REMOTE_ADDR":     "5.6.7.8",
    	}
    	req, err := RequestFromMap(env)
    	if err != nil {
    		t.Fatalf("RequestFromMap: %v", err)
    	}
    	if e, g := "5.6.7.8:0", req.RemoteAddr; e != g {
    		t.Errorf("RemoteAddr: got %q; want %q", g, e)
    	}
    }
    
    func TestResponse(t *testing.T) {
    	var tests = []struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 14 15:42:03 UTC 2020
    - 5.2K bytes
    - Viewed (0)
  9. src/net/file_wasip1_test.go

    	} else {
    		testIsTCPAddr(t, "LocalAddr", c.LocalAddr())
    		testIsTCPAddr(t, "RemoteAddr", c.RemoteAddr())
    	}
    	if c, ok := newFileConn(newFD("udp", -1)).(*UDPConn); !ok {
    		t.Errorf("newFileConn: udp conn type mismatch: %T", c)
    	} else {
    		testIsUDPAddr(t, "LocalAddr", c.LocalAddr())
    		testIsUDPAddr(t, "RemoteAddr", c.RemoteAddr())
    	}
    }
    
    func testIsTCPAddr(t *testing.T, method string, addr Addr) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 13 21:06:56 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  10. internal/handlers/proxy.go

    		}
    	}
    
    	return addr
    }
    
    // GetSourceIPRaw retrieves the IP from the request headers
    // and falls back to r.RemoteAddr when necessary.
    // however returns without bracketing.
    func GetSourceIPRaw(r *http.Request) string {
    	addr := GetSourceIPFromHeaders(r)
    	if addr == "" {
    		addr = r.RemoteAddr
    	}
    
    	// Default to remote address if headers not set.
    	raddr, _, _ := net.SplitHostPort(addr)
    	if raddr == "" {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Dec 22 00:56:55 UTC 2023
    - 5.1K bytes
    - Viewed (0)
Back to top