I'd like to suggest that the default behavior be the same as XMLHttpRequest:
"If the redirect does not violate security (it is same origin for instance), infinite loop precautions, and the scheme is supported, transparently follow the redirect" I think the only optional setting needed would be to not follow redirects, but even that isn't supported today by XMLHttpRequest, so how important is having such a setting. I'm not sure if the goal of makeRequest should be to provide some fancy new service (I'm over-exaggerating, but it's a slippery slope). If something more complex is needed by a Social App, it can always host the service itself and use makeRequest to invoke such services. After all, isn't that the point of makeRequest?! Thanks for Google groups link. --Randy Hudson From: John Hjelmstad <[email protected]> To: [email protected] Date: 11/16/2009 05:34 PM Subject: Re: 3xx shouldn't be classified as errors in gadgets.io.makeRequest @see http://groups.google.com/group/opensocial-and-gadgets-spec/browse_thread/thread/716acaa66ceba244 Seems to me that adding a FOLLOW_REDIRECTS option to makeRequest's params would make sense, assuming all security concerns are resolved. --j On Mon, Nov 16, 2009 at 2:28 PM, Randy Hudson <[email protected]> wrote: > It would be great if developing/migrating a Web UI for use as a Gadget > imposed the smallest possible "penalty". For the most part, makeRequest > is the alternative to what would have been done via XmlHttpRequest in the > original, "standalone" version of the same web app. To me, this suggests > that gadgets.io.makeRequest should emulate the behavior of XmlHttpRequest > as much as possible, including following redirects (to locations at the > same host). > > Developers migrating existing apps to run as a gadget may choose to > wrapper XmlHttpRequest (or existing equivalent, e.g. dojo.xhr) instead of > changing all of their code that makes such calls. This approach also > makes it possible to reuse code in both remote (i.e. in a gadget > container) and local contexts. > > If makeRequest doesn't follow redirects, even developers starting from > scratch would be encouraged to wrapper makeRequest with their own utility. > I wouldn't want to write javascript to follow redirects while detecting > redirect cycles every time I do XHR. > > -Randy Hudson > > > > From: > John Hjelmstad <[email protected]> > To: > [email protected], [email protected], [email protected], > [email protected] > Date: > 11/11/2009 04:33 PM > Subject: > Re: 3xx shouldn't be classified as errors in gadgets.io.makeRequest > > > > On Wed, Nov 11, 2009 at 12:54 PM, <[email protected]> wrote: > > > Is it clear from the OS specification that redirects should (or should > > not be) followed? > > > > Not too sure... > > > > > > Would this be something that we would want to add, along with perhaps a > > parameter to turn it on/off? > > > ...but I'd be in favor of this. > > > > > > > > http://codereview.appspot.com/152070 > > > >

