Skip to content

refactor(http): remove deprecated remote_ip_header fallback#628

Open
Ferryx349 wants to merge 1 commit into
cameri:mainfrom
Ferryx349:m4
Open

refactor(http): remove deprecated remote_ip_header fallback#628
Ferryx349 wants to merge 1 commit into
cameri:mainfrom
Ferryx349:m4

Conversation

@Ferryx349
Copy link
Copy Markdown
Collaborator

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

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 25, 2026

🦋 Changeset detected

Latest commit: 44477a6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Patch

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>
@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 65.081% (-0.04%) from 65.119% — Ferryx349:m4 into cameri:main

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'] in getRemoteAddress.
  • Updated unit tests to use network.remoteIpHeader instead 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_header config was partially updated but not replaced. Consider deleting the duplicate or repurposing it to assert that providing only network.remote_ip_header no longer affects getRemoteAddress (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 thread src/utils/http.ts
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants