refactor(http): remove deprecated remote_ip_header fallback#628
Open
Ferryx349 wants to merge 1 commit into
Open
refactor(http): remove deprecated remote_ip_header fallback#628Ferryx349 wants to merge 1 commit into
Ferryx349 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 44477a6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
Collaborator
There was a problem hiding this comment.
Pull request overview
This PR removes support for the deprecated network.remote_ip_header configuration key in the HTTP utilities, standardizing remote address extraction on network.remoteIpHeader.
Changes:
- Removed the runtime fallback (and warning) that read
settings.network['remote_ip_header']ingetRemoteAddress. - Updated unit tests to use
network.remoteIpHeaderinstead of the deprecated snake_case key. - Added a changeset entry documenting the refactor.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/utils/http.ts |
Drops the deprecated remote_ip_header fallback in getRemoteAddress, relying only on remoteIpHeader. |
test/unit/utils/http.spec.ts |
Updates/adjusts tests around getRemoteAddress configuration to align with remoteIpHeader. |
.changeset/remove-deprecated-remote-ip-header.md |
Documents the removal of deprecated config support for release notes. |
Comments suppressed due to low confidence (1)
test/unit/utils/http.spec.ts:40
- There are now two identical test cases (same settings shape and same expectation). This looks like the old test for the deprecated
network.remote_ip_headerconfig was partially updated but not replaced. Consider deleting the duplicate or repurposing it to assert that providing onlynetwork.remote_ip_headerno longer affectsgetRemoteAddress(i.e., it should fall back to the socket address).
it('returns address using network.remoteIpHeader when set', () => {
expect(
getRemoteAddress(
request,
{ network: { remoteIpHeader: header, trustedProxies: [socketAddress] } } as any,
)
).to.equal(address)
})
it('returns address using network.remoteIpHeader when set (duplicate shape)', () => {
expect(
getRemoteAddress(
request,
{ network: { remoteIpHeader: header, trustedProxies: [socketAddress] } } as any,
)
).to.equal(address)
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
29
to
30
|
|
||
| export const getRemoteAddress = (request: IncomingMessage, settings: Settings): string => { |
Comment on lines
+2
to
+5
| "nostream": patch | ||
| --- | ||
|
|
||
| refactor(http): remove deprecated network.remote_ip_header fallback and rely on network.remoteIpHeader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR removes deprecated network.remote_ip_header support.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: