jquery - Detecting XHR CORS request in Grails -


i'm attempting cross-origin requests against grails (2.0.1) application. have grails cors pluging installed. using jquery.

how can detect xhr request? under conventional same domain ajax workflow use request.xhr object, returns false cors. other headers of request same standard call:

host, connection, content-length, cache-control, pragma, accept, origin, user-agent, content-type, dnt, referer, accept-encoding, accept-language, accept-charset, cookie

i need know if request xhr because returned content different.

you should use origin header. origin header added browsers on xhr requests. unlikely non-browser-based source include header on request.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -