aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/requests/requests.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-10-30 15:09:00 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-11-09 15:33:04 +0100
commit77e9f859c6ad75ba179dec74e5410cc651eaa49b (patch)
treeec89fe374d73d9de48cb971ad18cab7718e03223 /shared/extra-utils/requests/requests.ts
parentd2345ce920a5f35cd17ca8d89456dd98e9f11a2c (diff)
downloadPeerTube-77e9f859c6ad75ba179dec74e5410cc651eaa49b.tar.gz
PeerTube-77e9f859c6ad75ba179dec74e5410cc651eaa49b.tar.zst
PeerTube-77e9f859c6ad75ba179dec74e5410cc651eaa49b.zip
Add check params live tests
Diffstat (limited to 'shared/extra-utils/requests/requests.ts')
-rw-r--r--shared/extra-utils/requests/requests.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts
index 0e9d67f0b..6b00871e0 100644
--- a/shared/extra-utils/requests/requests.ts
+++ b/shared/extra-utils/requests/requests.ts
@@ -63,7 +63,7 @@ function makeUploadRequest (options: {
63 path: string 63 path: string
64 token?: string 64 token?: string
65 fields: { [ fieldName: string ]: any } 65 fields: { [ fieldName: string ]: any }
66 attaches: { [ attachName: string ]: any | any[] } 66 attaches?: { [ attachName: string ]: any | any[] }
67 statusCodeExpected?: number 67 statusCodeExpected?: number
68}) { 68}) {
69 if (!options.statusCodeExpected) options.statusCodeExpected = 400 69 if (!options.statusCodeExpected) options.statusCodeExpected = 400
@@ -93,7 +93,7 @@ function makeUploadRequest (options: {
93 } 93 }
94 }) 94 })
95 95
96 Object.keys(options.attaches).forEach(attach => { 96 Object.keys(options.attaches || {}).forEach(attach => {
97 const value = options.attaches[attach] 97 const value = options.attaches[attach]
98 if (Array.isArray(value)) { 98 if (Array.isArray(value)) {
99 req.attach(attach, buildAbsoluteFixturePath(value[0]), value[1]) 99 req.attach(attach, buildAbsoluteFixturePath(value[0]), value[1])