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
  • !709
An error occurred while fetching the assigned milestone of the selected merge_request.

close socket if upstream request fails

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/minrk/close-on-error into master 10 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: minrk

adds socket.end() to on('error') handlers for proxyReq and proxySocket

covers a case that I thought I was testing for in #708, but missed because the client error event simply didn't fire.

Compare
  • master (base)

and
  • latest version
    c6276639
    1 commit, 2 years ago

2 files
+ 9
- 1

    Preferences

    File browser
    Compare changes
lib/http-p‎roxy/passes‎
ws-inco‎ming.js‎ +1 -0
te‎st‎
lib-http-pr‎oxy-test.js‎ +8 -1
lib/http-proxy/passes/ws-incoming.js
+ 1
- 0
  • View file @ c6276639

  • Edit in single-file editor

  • Open in Web IDE


@@ -124,6 +124,7 @@ var passes = exports;
} else {
server.emit('error', err, req, socket);
}
socket.end();
}
}
test/lib-http-proxy-test.js
+ 8
- 1
  • View file @ c6276639

  • Edit in single-file editor

  • Open in Web IDE


@@ -280,17 +280,24 @@ describe('lib/http-proxy.js', function() {
client.on('open', function () {
client.send('hello there');
});
var count = 0;
function maybe_done () {
count += 1;
if (count === 2) done();
}
client.on('error', function (err) {
expect(err).to.be.an(Error);
expect(err.code).to.be('ECONNRESET');
maybe_done();
});
proxy.on('error', function (err) {
expect(err).to.be.an(Error);
expect(err.code).to.be('ECONNREFUSED');
proxyServer.close();
done();
maybe_done();
});
});
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:
Source branch: github/fork/minrk/close-on-error

Menu

Explore Projects Groups Snippets