How to use the builder-util-runtime.configureRequestUrl function in builder-util-runtime

To help you get started, we’ve selected a few builder-util-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electron-userland / electron-builder / packages / electron-updater / src / differentialDownloader / DifferentialDownloader.ts View on Github external
createRequestOptions(): RequestOptions {
    const result = {
      headers: {
        ...this.options.requestHeaders,
        accept: "*/*",
      },
    }
    configureRequestUrl(this.options.newUrl, result)
    // user-agent, cache-control and other common options
    configureRequestOptions(result)
    return result
  }
github electron-userland / electron-builder / packages / electron-updater / src / differentialDownloader / DifferentialDownloader.ts View on Github external
request.on("redirect", (statusCode: number, method: string, redirectUrl: string) => {
          this.logger.info(`Redirect to ${removeQuery(redirectUrl)}`)
          actualUrl = redirectUrl
          configureRequestUrl(new URL(actualUrl), requestOptions)
          request.followRedirect()
        })
        this.httpExecutor.addErrorAndTimeoutHandlers(request, reject)
github electron-userland / electron-builder / packages / electron-updater / src / electronHttpExecutor.ts View on Github external
return await options.cancellationToken.createPromise((resolve, reject, onCancel) => {
      const requestOptions = {
        headers: options.headers || undefined,
        redirect: "manual",
      }
      configureRequestUrl(url, requestOptions)
      configureRequestOptions(requestOptions)
      this.doDownload(requestOptions, {
        destination,
        options,
        onCancel,
        callback: error => {
          if (error == null) {
            resolve(destination)
          }
          else {
            reject(error)
          }
        },
        responseHandler: null,
      }, 0)
    })