Skip to content

Commit

Permalink
fix: allow redirects when requesting
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 23, 2024
1 parent 9f0a65f commit dca7601
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function downloadToStream(url: string, stream: AnyStream, hashType: strin
let done = 0;
let lastPercent = 0;

get(url).on('error', err => {
get(url, { allowInsecureRedirect: true, followAllRedirects: true }).on('error', err => {
reject(err);
}).on('response', data => {
length = parseInt(data.headers['content-length'] || '0', 10);
Expand Down
5 changes: 3 additions & 2 deletions src/types/cypress__request.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
declare module '@cypress/request' {
import request from "request"
export = request
import request, { RequestCallback, CoreOptions, Request } from "request"
export function get(uri: string, options?: CoreOptions & { allowInsecureRedirect: true }, callback?: RequestCallback): Request
export default request
}

0 comments on commit dca7601

Please sign in to comment.