nikolalsvk / render_async

render_async lets you include pages asynchronously with AJAX
https://rubygems.org/gems/render_async/
MIT License
1.08k stars 75 forks source link

Default headers completely removed #72

Closed cjmarkham closed 4 years ago

cjmarkham commented 5 years ago

The following change to allow configurable AJAX requests means that all default headers are removed. https://github.com/renderedtext/render_async/pull/52/files#diff-78580168b9e5984e5b82be19fc129f98R27 This posed a problem for those of us using request.xhr? in our controllers, which relies on the X-Requested-With header.

It's not a huge issue since I was able to add the header to the helper but it should be noted somewhere in the repo.

nikolalsvk commented 5 years ago

Hey @cjmarkham, thanks for creating this issue 💚

I'll try to change this behaviour to NOT change default headers when request is made. We can leave this issue as a documentation for it for now.

nikolalsvk commented 5 years ago

Hey @cjmarkham, I'm investigating this issue and I can't reproduce removing of headers :(

Could you post your use case and/or some screenshots so I can reproduce this issue and fix it?

Thank you 🍰

bdeterling commented 5 years ago

I can confirm this. All headers are removed. I worked around it by adding this to the render_async call:

 headers: { 'X-Requested-With' => 'XMLHttpRequest' })
nikolalsvk commented 4 years ago

Hello, folks. I released a fix for this in 2.1.6. Can you try it out and let me if it's solved? Thanks 🙇