Skip to content

Commit e224a96

Browse files
authored
Merge pull request #12 from ParamagicDev/patch-1
docs: Add a note about an issue with Turbolinks
2 parents b330fac + dadd006 commit e224a96

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ import { Turbo } from "@hotwired/turbo-rails"
4444
window.Turbo = Turbo
4545
```
4646

47+
# Known Issues
48+
49+
`FetchRequest` sets a `"X-Requested-With": "XmlHttpRequest"` header. If you have not upgraded to Turbo and still use `Turbolinks` in your Gemfile, this means
50+
you will not be able to check if the request was redirected.
51+
52+
```js
53+
const request = new FetchRequest('post', 'localhost:3000/my_endpoint', { body: { name: 'Request.JS' }})
54+
const response = await request.perform()
55+
response.redirected // => will always be false.
56+
```
57+
4758
# License
4859

4960
Rails Request.JS is released under the [MIT License](LICENSE).

0 commit comments

Comments
 (0)