Forum OpenACS Development: Re: Request Processor's rp_filter and AJAX
3: Re: Request Processor's rp_filter and AJAX (response to 1)
Posted by Neophytos Demetriou on 06/28/17 07:44 PM
I think having "X-Requested-With:XMLHttpRequest" header present is in the right direction. In that case, the API responds with a JSON response (instead of html) that says that the call did not succeed (possibly providing further info e.g. redirect url OR error code). Then, you handle the case in the frontend e.g. provide the user with a login box and so on. Just my 2 cents.
4: Re: Request Processor's rp_filter and AJAX (response to 3)
Posted by Gustaf Neumann on 06/28/17 10:23 PM
I think as well, that this is straightforward. it should be possible to set the header-field explicitly when needed.
Committed in: http://cvs.openacs.org/changelog/OpenACS?cs=oacs-5-9%3Agustafn%3A20170628202027