Ajax call is not interpreted as an ajax call
I'm having an issue which only appears with LSWS. I have a rails 1.2 app on LSWS 2.2.2 with LSAPI (which also hosts another rails app). Everything works perfectly fine, except Ajax calls : they all render non-ajax versions of the pages. I have the feeling that the application does not receive one of the headers (maybe X-Requested-With).
Here are the typical headers sent by the client on these requests:
User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:188.8.131.52) Gecko/20070219 Firefox/184.108.40.206
Content-Type application/x-www-form-urlencoded; charset=UTF-8
Did anyone meet this issue ?
Is there something to configure at LSWS level with regards to the headers ?
Our rails easy configuration uses 404 handler to forward requests to backend Rails application, if there are both AJAX and non-AJAX version of pages for the same URL, the static version of the page will be served for sure.
To workaround this, you can use a vhost level rewrite rule to detect AJAX call by testing existence of "X-Requested-With" header.
I've decided to try an upgrade and it worked! (without the rewriting work-around).
After upgrading from 2.2.2 to 2.2.6, and installing ruby-lsapi 2.0, everything is working fine.
Thanks for your work
|All times are GMT -7. The time now is 06:50 PM.|