mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-02-01 16:47:23 +00:00
Throw an error if user is using XMLHttpRequest
Following changes from @jdalrymple in his `jobs-pipeline-endpoints` branch
This commit is contained in:
parent
adc1985457
commit
61313ebc21
@ -32,6 +32,9 @@ function defaultRequest(
|
||||
class RequestHelper {
|
||||
static async get(service, endpoint, options = {}, requestOptions = {}) {
|
||||
if (requestOptions && requestOptions.stream === true) {
|
||||
if (service.useXMLHttpRequest) {
|
||||
throw new Error('Cannot use streaming functionality with XMLHttpRequest. Please instantiate without this option to use streaming');
|
||||
}
|
||||
return StreamableRequest.get(defaultRequest(service, endpoint, {
|
||||
headers: service.headers,
|
||||
qs: options,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user