Add get_http_request_ip for fetching a requester's IP address.

Review Request #14630 — Created Nov. 28, 2025 and updated — Latest diff uploaded

Information

Djblets
release-5.x

Reviewers

djblets.http.get_http_request_ip returns the IP address stored in the
the X-Real-IP or X-Forwarded-For headers (if available), falling
back to the raw client IP address if needed.

Since this operates off of HTTP headers, it's up to the configured
servers to ensure any client-provided headers are stripped out and that
these are set to trusted values.

Unit tests pass.

Commits

Files