Skip to content

Commit bdace03

Browse files
w666vm-orbit
andauthored
Update axios to 1.16.0 and mocha to 11.7.5 (#1494)
- Fix parsing headers after axios update Co-authored-by: Vasily Martynov <vasily.martynov@orbitwellington.com>
1 parent 94a127d commit bdace03

3 files changed

Lines changed: 18 additions & 16 deletions

File tree

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"author": "Vinay Pulim <v@pulim.com>",
99
"dependencies": {
10-
"axios": "^1.15.0",
10+
"axios": "^1.16.0",
1111
"axios-ntlm": "^1.4.6",
1212
"debug": "^4.4.3",
1313
"follow-redirects": "^1.15.11",
@@ -58,7 +58,7 @@
5858
"express": "^5.1.0",
5959
"finalhandler": "^2.1.0",
6060
"glob": "^13.0.0",
61-
"mocha": "^11.7.4",
61+
"mocha": "^11.7.5",
6262
"nyc": "^18.0.0",
6363
"prettier": "^3.6.2",
6464
"readable-stream": "^4.7.0",

src/http.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,12 @@ export class HttpClient implements IHttpClient {
248248
};
249249

250250
if (_this.options.parseReponseAttachments) {
251-
const isMultipartResp = res.headers['content-type'] && res.headers['content-type'].toLowerCase().indexOf('multipart/related') > -1;
251+
const contentTypeHeader = res.headers['content-type'];
252+
const contentType = typeof contentTypeHeader === 'string' ? contentTypeHeader : Array.isArray(contentTypeHeader) ? contentTypeHeader[0] : '';
253+
const isMultipartResp = contentType.toLowerCase().indexOf('multipart/related') > -1;
252254
if (isMultipartResp) {
253255
let boundary;
254-
const parsedContentType = new MIMEType(res.headers['content-type']);
256+
const parsedContentType = new MIMEType(contentType);
255257
if (parsedContentType) {
256258
boundary = parsedContentType.parameters.get('boundary');
257259
}

0 commit comments

Comments
 (0)