aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/requests
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/requests')
-rw-r--r--shared/extra-utils/requests/requests.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts
index 8b5cddf4a..38e24d897 100644
--- a/shared/extra-utils/requests/requests.ts
+++ b/shared/extra-utils/requests/requests.ts
@@ -26,6 +26,7 @@ function makeGetRequest (options: {
26 contentType?: string 26 contentType?: string
27 range?: string 27 range?: string
28 redirects?: number 28 redirects?: number
29 accept?: string
29}) { 30}) {
30 if (!options.statusCodeExpected) options.statusCodeExpected = HttpStatusCode.BAD_REQUEST_400 31 if (!options.statusCodeExpected) options.statusCodeExpected = HttpStatusCode.BAD_REQUEST_400
31 if (options.contentType === undefined) options.contentType = 'application/json' 32 if (options.contentType === undefined) options.contentType = 'application/json'
@@ -36,6 +37,7 @@ function makeGetRequest (options: {
36 if (options.token) req.set('Authorization', 'Bearer ' + options.token) 37 if (options.token) req.set('Authorization', 'Bearer ' + options.token)
37 if (options.query) req.query(options.query) 38 if (options.query) req.query(options.query)
38 if (options.range) req.set('Range', options.range) 39 if (options.range) req.set('Range', options.range)
40 if (options.accept) req.set('Accept', options.accept)
39 if (options.redirects) req.redirects(options.redirects) 41 if (options.redirects) req.redirects(options.redirects)
40 42
41 return req.expect(options.statusCodeExpected) 43 return req.expect(options.statusCodeExpected)