From bf6a8213ec8cc85b99d90745fc1f4fff532c0c07 Mon Sep 17 00:00:00 2001 From: Parth Verma Date: Mon, 5 Aug 2024 21:18:26 -0700 Subject: [PATCH] Bumped postman-request to postman-request@2.88.1-postman.38 --- package-lock.json | 14 ++--- package.json | 2 +- test/integration/request-flow/headers.test.js | 60 ++++++++++++++++++- 3 files changed, 66 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index a76d7e091..4da0dcc8c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "node-oauth1": "1.3.0", "performance-now": "2.1.0", "postman-collection": "4.5.0", - "postman-request": "2.88.1-postman.37", + "postman-request": "2.88.1-postman.38", "postman-sandbox": "5.1.1", "postman-url-encoder": "3.0.5", "serialised-error": "1.1.3", @@ -7978,9 +7978,9 @@ } }, "node_modules/postman-request": { - "version": "2.88.1-postman.37", - "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.37.tgz", - "integrity": "sha512-TpHeMnvO5xvlYCYp8QntLR1Fq0hohWGOLbf9RBqO5JTMdPWZpGBbR8xs11tHsZRVMDXWFg4m960ItkcDxiaWSA==", + "version": "2.88.1-postman.38", + "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.38.tgz", + "integrity": "sha512-gQpK/jjTreGGv7VKeCzwlPa8dulOBANpXfLFuYUEu7sTWQTC6Kv60kfW0z047p7ujMmVwsZkrre/QP/u3DkdnQ==", "dependencies": { "@postman/form-data": "~3.1.1", "@postman/tough-cookie": "~4.1.3-postman.1", @@ -16632,9 +16632,9 @@ } }, "postman-request": { - "version": "2.88.1-postman.37", - "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.37.tgz", - "integrity": "sha512-TpHeMnvO5xvlYCYp8QntLR1Fq0hohWGOLbf9RBqO5JTMdPWZpGBbR8xs11tHsZRVMDXWFg4m960ItkcDxiaWSA==", + "version": "2.88.1-postman.38", + "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.38.tgz", + "integrity": "sha512-gQpK/jjTreGGv7VKeCzwlPa8dulOBANpXfLFuYUEu7sTWQTC6Kv60kfW0z047p7ujMmVwsZkrre/QP/u3DkdnQ==", "requires": { "@postman/form-data": "~3.1.1", "@postman/tough-cookie": "~4.1.3-postman.1", diff --git a/package.json b/package.json index d3d223ad2..a9824cd35 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "node-oauth1": "1.3.0", "performance-now": "2.1.0", "postman-collection": "4.5.0", - "postman-request": "2.88.1-postman.37", + "postman-request": "2.88.1-postman.38", "postman-sandbox": "5.1.1", "postman-url-encoder": "3.0.5", "serialised-error": "1.1.3", diff --git a/test/integration/request-flow/headers.test.js b/test/integration/request-flow/headers.test.js index 687fd8403..484ce0004 100644 --- a/test/integration/request-flow/headers.test.js +++ b/test/integration/request-flow/headers.test.js @@ -117,6 +117,25 @@ var sinon = require('sinon'), }] } } + }, { + name: 'http2', + request: { + url: 'https://postman-echo.com/get', + method: 'GET' + }, + protocolProfileBehavior: { + protocolVersion: 'http2' + } + }, + { + name: 'auto', + request: { + url: 'https://postman-echo.com/get', + method: 'GET' + }, + protocolProfileBehavior: { + protocolVersion: 'auto' + } }] } }, function (err, results) { @@ -131,8 +150,8 @@ var sinon = require('sinon'), sinon.assert.calledOnce(testrun.done); sinon.assert.calledWith(testrun.done.getCall(0), null); - sinon.assert.callCount(testrun.request, 6); - sinon.assert.callCount(testrun.response, 6); + sinon.assert.callCount(testrun.request, 8); + sinon.assert.callCount(testrun.response, 8); }); it('should handle duplicate headers correctly', function () { @@ -263,4 +282,41 @@ var sinon = require('sinon'), expect(request.headers.members[request.headers.count() - 1]) .to.deep.equal(new Header({ key: 'Content-Length', system: true, value: '253' })); }); + + it('should have all request headers in http2 in debug data', function () { + sinon.assert.calledWith(testrun.request.getCall(6), null); + sinon.assert.calledWith(testrun.response.getCall(6), null); + + var history = testrun.response.getCall(6).lastArg, + executionData = history.execution.data[0], + requestHeaders = executionData.request.headers; + + const headersToCheck = new Set(['accept', 'cache-control', 'accept-encoding', + 'cookie', 'postman-token', ':path', ':method', ':authority', ':scheme', 'user-agent']); + + expect(executionData.response.httpVersion).to.eql('2.0'); + + requestHeaders.forEach(({ key }) => { + expect(headersToCheck.has(key.toLowerCase())).to.eql(true, `Header ${key} not found`); + }); + }); + + it('should have all request headers in http2 in debug auto', function () { + sinon.assert.calledWith(testrun.request.getCall(7), null); + sinon.assert.calledWith(testrun.response.getCall(7), null); + + var history = testrun.response.getCall(7).lastArg, + executionData = history.execution.data[0], + requestHeaders = executionData.request.headers; + + + const headersToCheck = new Set(['accept', 'cache-control', 'accept-encoding', + 'cookie', 'postman-token', ':path', ':method', ':authority', ':scheme', 'user-agent']); + + expect(executionData.response.httpVersion).to.eql('2.0'); + + requestHeaders.forEach(({ key }) => { + expect(headersToCheck.has(key.toLowerCase())).to.eql(true, `Header ${key} not found`); + }); + }); });