build(deps-dev): bump supertest from 6.3.0 to 7.3.0 (#7494)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Noritaka Kobayashi · committed by GitHub · parent cf6722b · Browse files · 4 files·+23 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Signed-off-by: Noritaka Kobayashi <arukimedesu1166777@gmail.com>
Diff stats
4 files+23 added−13 removed
- tests:+22 added−12 removed
- other:+1 added−1 removed
Provenance
- Commit
6d2df03- Tree
4be72de- Author
Noritaka Kobayashi <arukimedesu1166777@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
cf6722b
4 files changed+23 added−13 removed
modified:test/acceptance/downloads.js+2 added-2 removed
1234567830 unmodified lines3940414242434344454647
var app = require('../../examples/downloads') , request = require('supertest');var utils = require('../support/utils');
describe('downloads', function(){ describe('GET /', function(){ it('should have a link to amazing.txt', function(done){30 unmodified lines })
describe('GET /files/../index.js', function () { it('should respond with 403', function (done) { request(app) .get('/files/../index.js') utils.getRawPath(request(app), '/files/../index.js') .expect(403, done) }) })})modified:test/support/utils.js+15 added
15 unmodified lines1617181920212223242526272829303132333435363738394061 unmodified lines15 unmodified linesexports.shouldHaveHeader = shouldHaveHeaderexports.shouldNotHaveBody = shouldNotHaveBodyexports.shouldNotHaveHeader = shouldNotHaveHeader;exports.shouldSkipQuery = shouldSkipQueryexports.getRawPath = getRawPath
/** * Send a GET request without URL dot-segment normalization. * * @param {object} agent SuperTest request factory * @param {string} path Request path * @returns {object} SuperTest request */
function getRawPath (agent, path) { return agent.get(path).on('request', function (test) { test.req.path = path })}
/** * Assert that a supertest response has a specific body. * * @param {Buffer} buf * @returns {function}61 unmodified linesmodified:test/express.static.js+5 added-10 removed
79 unmodified lines80 .expect('<p>tobi, loki, jane</p>', done)81 })82 83 it('should support ../', function (done) {84- request(this.app)85- .get('/users/../todo.txt')84+ utils.getRawPath(request(this.app), '/users/../todo.txt')85 .expect(200, '- groceries', done)86 })87 88 it('should support HEAD', function (done) {178 unmodified lines267 .expect(404, 'Not Found', done)268 })269 270 it('should fall-through when traversing past root', function (done) {272- request(this.app)273- .get('/users/../../todo.txt')271+ utils.getRawPath(request(this.app), '/users/../../todo.txt')272 .expect(404, 'Not Found', done)273 })274 275 it('should fall-through when URL too long', function (done) {65 unmodified lines341 .expect(400, /BadRequestError/, done)342 })343 344 it('should 403 when traversing past root', function (done) {347- request(this.app)348- .get('/users/../../todo.txt')345+ utils.getRawPath(request(this.app), '/users/../../todo.txt')346 .expect(403, /ForbiddenError/, done)347 })348 349 it('should 404 when URL too long', function (done) {224 unmodified lines574 this.app = createApp(fixtures, { 'fallthrough': false })575 })576 577 it('should catch urlencoded ../', function (done) {581- request(this.app)582- .get('/users/%2e%2e/%2e%2e/todo.txt')578+ utils.getRawPath(request(this.app), '/users/%2e%2e/%2e%2e/todo.txt')579 .expect(403, done)580 })581 582 it('should not allow root path disclosure', function (done) {587- request(this.app)588- .get('/users/../../fixtures/todo.txt')583+ utils.getRawPath(request(this.app), '/users/../../fixtures/todo.txt')584 .expect(403, done)585 })586 })587 223 unmodified linesmodified:package.json+1 added-1 removed
74 unmodified lines75 "mocha": "^11.7.5",76 "morgan": "1.12.1",77 "nyc": "^17.1.0",78 "pbkdf2-password": "1.2.1",79- "supertest": "^6.3.0",79+ "supertest": "^7.3.0",80 "vhost": "~3.0.2"81 },82 "engines": {83 "node": ">= 18"16 unmodified lines