Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • N node-http-proxy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 482
    • Issues 482
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 102
    • Merge requests 102
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • http ... PARTY!
  • node-http-proxy
  • Merge requests
  • !1018

Conserve headers' case

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/diegonc/t/conserve-header-case into master Jun 02, 2016
  • Overview 1
  • Commits 2
  • Pipelines 0
  • Changes 3

Created by: diegonc

Since version 1.0.0, Node has added support for getting the raw headers from an incomming message, like the ones http.request passes to its callback.

This opens the possibility of sending the headers to the client using the same capitalization as the target server used when responding to our request.

What the PR proposes to accomplish this goal is to add a new option, keepHeaderCase, that instructs the writeHeaders outgoing pass to build a map of lower-cased headers to its original representation located in the rawHeaders property of proxyRes.

To keep backwards compatibility with earlier versions of Node, the outgoing pass above uses the keys of the proxyRes.headers map as the first parameter of res.setHeader.

There are some corner cases regarding headers set by preceding passes; it wasn't clear to me what to do with those. But otherwise, the simple test added by the first commit in this PR works ok.

What do you think about this feature?

Thanks, Diego

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/diegonc/t/conserve-header-case