Better logic for determining client IP addresses from incoming requests.#2477
Better logic for determining client IP addresses from incoming requests.#2477
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to improve how the server determines and records the client IP address from inbound HTTP/gRPC requests (especially when behind proxies), and reduces noisy logging when storage operations are canceled via context.
Changes:
- Update client address extraction to consider multiple candidate addresses (e.g.,
X-Forwarded-Forlists) and attempt to skip loopback proxy addresses. - Suppress storage read error logs when the underlying error is
context.Canceled. - Document both changes in the Unreleased changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
server/api.go |
Reworks client IP/port extraction logic from request/context sources. |
server/core_storage.go |
Avoids logging storage read errors when the context is canceled. |
CHANGELOG.md |
Notes the changed IP extraction behavior and the storage logging fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR refines server-side request handling by improving client IP extraction logic (used for tracing/metrics/auditing) and reducing noisy logging on canceled storage operations.
Changes:
- Update client address extraction to consider multiple X-Forwarded-For / peer candidates and skip loopback proxy addresses.
- Suppress error logging for
context.Canceledduring storage object reads. - Document both changes in the unreleased changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
server/api.go |
Reworks client IP/port extraction to process multiple candidate addresses rather than a single value. |
server/core_storage.go |
Avoids logging expected context.Canceled errors when iterating storage read rows. |
CHANGELOG.md |
Adds entries describing the client IP logic change and cancellation log noise reduction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Updates request/client address extraction to better handle multi-hop forwarding headers and reduces noise from expected cancellation errors during storage reads.
Changes:
- Update client IP/port extraction to consider multiple
X-Forwarded-Forcandidates and skip empty/loopback entries. - Suppress error logs for
context.Canceledduring storage object reads. - Document both changes in the Unreleased changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
server/api.go |
Reworks client address extraction from context/request headers and peer/RemoteAddr. |
server/core_storage.go |
Avoids logging expected context-cancellation errors from rows.Err(). |
CHANGELOG.md |
Notes the updated client IP logic and storage cancellation logging change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
This PR refines how the server determines the client IP/port for incoming gRPC/HTTP requests and reduces noisy logging when storage reads are canceled, with corresponding changelog updates.
Changes:
- Update client address extraction to consider multiple candidate addresses (e.g.,
X-Forwarded-Forchain) rather than a single value. - Suppress storage read error logs when the operation ends due to
context.Canceled. - Document both changes in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
server/api.go |
Reworks client IP/port extraction from request/context metadata using a candidate-address list. |
server/core_storage.go |
Avoids logging for context-canceled storage read operations. |
CHANGELOG.md |
Adds entries describing the updated client IP logic and reduced cancellation logging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
No description provided.