Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix Response type. #9275

Merged
merged 2 commits into from Nov 23, 2020
Merged

chore: Fix Response type. #9275

merged 2 commits into from Nov 23, 2020

Conversation

sainthkh
Copy link
Contributor

@sainthkh sainthkh commented Nov 23, 2020

User facing changelog

Added the type of redirects and changed redirectedToUrl optional.

Additional details

  • Why was this change necessary? => redirects was missing and redirectedToUrl was wrong.
  • What is affected by this change? => N/A
  • Any implementation details to explain?

The following code told me that the type of redirects is string[].

redirects.push([incomingRes.statusCode, newUrl].join(': '))

I checked the code below and learned that redirectedToUrl isn't removed. It was optional.

.then((resp) => {
resp.duration = Date.now() - ms
resp.allRequestResponses = requestResponses
if (redirects.length) {
resp.redirects = redirects
}
if ((options.followRedirect === false) && resp.headers.location) {
// resolve the new location head against
// the current url
resp.redirectedToUrl = url.resolve(options.url, resp.headers.location)
}

How has the user experience changed?

N/A

PR Tasks

  • Add/Update tests.
  • Has the original issue or this PR been tagged with a release in ZenHub?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 23, 2020

Thanks for taking the time to open a PR!

@sainthkh sainthkh marked this pull request as ready for review November 23, 2020 06:14
@flotwig flotwig merged commit 8b78af3 into cypress-io:develop Nov 23, 2020
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typings for Cypress.Response are outdated
2 participants