PDA

View Full Version : How to set defaultHeaders for ScriptTagProxy



anicola
30 Oct 2007, 12:39 AM
Is it possible to configure the Connection used by ScriptTagProxy? This is possible when configuring HttpProxy and I need to do the same to set defaultHeaders used by ScriptTagProxy in order to set Accept header. I think this is needed for implementing content-type negotiation when using RESTful architectures which make use of request redirection for resource de-referencing.

Thanks in advance! ;)

Animal
30 Oct 2007, 12:45 AM
You can't. ScriptTagProxy uses....... a script tag!

anicola
30 Oct 2007, 1:02 AM
So there's no way to use XSS and by-pass same-origin-policy?! :(

Looking at the ScriptTagProxy source I've found it seems to use a connection object:

var conn = this;

window[trans.cb] = function(o){
conn.handleResponse(o, trans);
};

There's no way to configure it?

This security measure is a big clash between AJAX and RESTful architectures, as I wouldn't like to use the origin server as proxy for the request/redirect, letting the client stuff for the client

Animal
30 Oct 2007, 1:09 AM
No, it uses a script tag to get round the same origin policy. Hence its name.