Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for GetSourceIP (0.11 sec)

  1. internal/handlers/proxy.go

    	// Default to remote address if headers not set.
    	raddr, _, _ := net.SplitHostPort(addr)
    	if raddr == "" {
    		return addr
    	}
    	return raddr
    }
    
    // GetSourceIP retrieves the IP from the request headers
    // and falls back to r.RemoteAddr when necessary.
    func GetSourceIP(r *http.Request) string {
    	addr := GetSourceIPRaw(r)
    	if strings.ContainsRune(addr, ':') {
    		return "[" + addr + "]"
    	}
    	return addr
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Dec 22 00:56:55 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  2. internal/handlers/proxy_test.go

    	}
    
    	for _, v := range headers {
    		req := &http.Request{
    			Header: http.Header{
    				v.key: []string{v.val},
    			},
    		}
    		res := GetSourceIP(req)
    		if res != v.expected {
    			t.Errorf("wrong header for %s: got %s want %s", v.key, res,
    				v.expected)
    		}
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Dec 22 00:56:55 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  3. cmd/bucket-handlers.go

    			BucketName:   bucket,
    			Object:       objInfo,
    			ReqParams:    extractReqParams(r),
    			RespElements: extractRespElements(w),
    			UserAgent:    r.UserAgent(),
    			Host:         handlers.GetSourceIP(r),
    		})
    	}
    
    	// Clean up transitioned objects from remote tier
    	for _, os := range oss {
    		if os == nil { // skip objects that weren't deleted due to invalid versionID etc.
    			continue
    		}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Sep 12 12:24:04 UTC 2024
    - 63.4K bytes
    - Viewed (0)
  4. cmd/object-handlers.go

    		BucketName:   bucket,
    		Object:       objInfo,
    		ReqParams:    extractReqParams(r),
    		RespElements: extractRespElements(w),
    		UserAgent:    r.UserAgent(),
    		Host:         handlers.GetSourceIP(r),
    	})
    }
    
    func (api objectAPIHandlers) getObjectHandler(ctx context.Context, objectAPI ObjectLayer, bucket, object string, w http.ResponseWriter, r *http.Request) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Oct 05 05:16:15 UTC 2024
    - 117.4K bytes
    - Viewed (0)
  5. internal/logger/message/audit/entry.go

    func ToEntry(w http.ResponseWriter, r *http.Request, reqClaims map[string]interface{}, deploymentID string) audit.Entry {
    	entry := NewEntry(deploymentID)
    
    	entry.RemoteHost = handlers.GetSourceIP(r)
    	entry.UserAgent = r.UserAgent()
    	entry.ReqClaims = reqClaims
    	entry.ReqHost = r.Host
    	entry.ReqPath = r.URL.Path
    
    	q := r.URL.Query()
    	reqQuery := make(map[string]string, len(q))
    	for k, v := range q {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  6. cmd/http-tracer.go

    				ReqInfo: madmin.TraceRequestInfo{
    					Time:     reqStartTime,
    					Proto:    r.Proto,
    					Method:   r.Method,
    					RawQuery: redactLDAPPwd(r.URL.RawQuery),
    					Client:   handlers.GetSourceIP(r),
    					Headers:  reqHeaders,
    					Path:     reqPath,
    					Body:     reqRecorder.Data(),
    				},
    				RespInfo: madmin.TraceResponseInfo{
    					Time:       reqEndTime,
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Sep 24 17:13:00 UTC 2024
    - 6K bytes
    - Viewed (0)
  7. cmd/handler-utils.go

    	if cred.ParentUser != "" {
    		principalID = cred.ParentUser
    	}
    
    	// Success.
    	m := map[string]string{
    		"region":          region,
    		"principalId":     principalID,
    		"sourceIPAddress": handlers.GetSourceIP(r),
    		// Add more fields here.
    	}
    	if rangeField := r.Header.Get(xhttp.Range); rangeField != "" {
    		m["range"] = rangeField
    	}
    
    	if _, ok := r.Header[xhttp.MinIOSourceReplicationRequest]; ok {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jun 10 15:31:51 UTC 2024
    - 15.5K bytes
    - Viewed (0)
  8. cmd/utils.go

    	bucket := vars["bucket"]
    	object := likelyUnescapeGeneric(vars["object"], url.PathUnescape)
    	reqInfo := &logger.ReqInfo{
    		DeploymentID: globalDeploymentID(),
    		RequestID:    reqID,
    		RemoteHost:   handlers.GetSourceIP(r),
    		Host:         getHostName(r),
    		UserAgent:    r.UserAgent(),
    		API:          api,
    		BucketName:   bucket,
    		ObjectName:   object,
    		VersionID:    strings.TrimSpace(r.Form.Get(xhttp.VersionID)),
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Aug 13 22:22:04 UTC 2024
    - 31.9K bytes
    - Viewed (0)
  9. cmd/object-multipart-handlers.go

    		BucketName:   bucket,
    		Object:       objInfo,
    		ReqParams:    extractReqParams(r),
    		RespElements: extractRespElements(w),
    		UserAgent:    r.UserAgent(),
    		Host:         handlers.GetSourceIP(r),
    	}
    	sendEvent(evt)
    
    	if objInfo.NumVersions > int(scannerExcessObjectVersions.Load()) {
    		evt.EventName = event.ObjectManyVersions
    		sendEvent(evt)
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Aug 31 18:25:48 UTC 2024
    - 39.2K bytes
    - Viewed (0)
  10. cmd/admin-handlers.go

    			hr := healResp{respBytes: respBytes, apiErr: apiErr}
    			respCh <- hr
    		}()
    	case hip.clientToken == "":
    		nh := newHealSequence(GlobalContext, hip.bucket, hip.objPrefix, handlers.GetSourceIP(r), hip.hs, hip.forceStart)
    		go func() {
    			respBytes, apiErr, errMsg := globalAllHealState.LaunchNewHealSequence(nh, objectAPI)
    			hr := healResp{respBytes, apiErr, errMsg}
    			respCh <- hr
    		}()
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Oct 04 11:32:32 UTC 2024
    - 99.7K bytes
    - Viewed (0)
Back to top