Skip to content
GitLab
    • Explore Projects Groups Snippets
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
  • !893

Removed unspecified trailing slash in proxy url

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/donasaur/master into master 9 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: donasaur

Previously, if target='http://localhost:9060/appEndpoint' and req.url='', the url the proxied request will hit is: 'http://localhost:9060/appEndpoint**/**'

With the change, if target='http://localhost:9060/appEndpoint' and req.url='', the url the proxied request will hit is: 'http://localhost:9060/appEndpoint'

This is helpful if the app endpoint is to a router that is sensitive to the trailing slash (e.g., a Rails router)

Compare
  • master (base)

and
  • latest version
    eb97bf54
    1 commit, 2 years ago

2 files
+ 2
- 2

    Preferences

    File browser
    Compare changes
lib/htt‎p-proxy‎
comm‎on.js‎ +1 -1
te‎st‎
lib-http-proxy‎-common-test.js‎ +1 -1
lib/http-proxy/common.js
+ 1
- 1
  • View file @ eb97bf54

  • Edit in single-file editor

  • Open in Web IDE


@@ -80,7 +80,7 @@ common.setupOutgoing = function(outgoing, options, req, forward) {
// Remark: Can we somehow not use url.parse as a perf optimization?
//
var outgoingPath = !options.toProxy
? (url.parse(req.url).path || '/')
? (url.parse(req.url).path || '')
: req.url;
//
test/lib-http-proxy-common-test.js
+ 1
- 1
  • View file @ eb97bf54

  • Edit in single-file editor

  • Open in Web IDE


@@ -332,7 +332,7 @@ describe('lib/http-proxy/common.js', function () {
{ path: '' }
}, { url : '' });
expect(outgoing.path).to.be('/');
expect(outgoing.path).to.be('');
});
});
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference: http-party/node-http-proxy!893
Source branch: github/fork/donasaur/master

Menu

Explore Projects Groups Snippets