Skip to content

Expose response.redirected to FetchResponse #22

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

Merged
merged 1 commit into from
Jun 13, 2021

Conversation

t27duck
Copy link
Contributor

@t27duck t27duck commented Jun 13, 2021

I could be completely off-base, but in the known limitations section in the README, I don't think this code actually would work...

  const request = new FetchRequest('post', 'localhost:3000/my_endpoint', { body: { name: 'Request.JS' }})
  const response = await request.perform()
  response.redirected // => will always be false.

I am pretty sure response in this case is a FetchResponse and not a Response, so redirected wouldn't be defined.

I exposed redirect from the internal respose object in FetchResponse to at least make the code in the README correct.

@marcelolx marcelolx merged commit 0eda429 into rails:main Jun 13, 2021
@t27duck t27duck deleted the expose_redirected branch July 2, 2021 19:25
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.

2 participants