Disables dataType redirection while selecting transport.
[jquery.git] / src / ajax.js
index 4b3ab76..f33bd49 100644 (file)
@@ -7,7 +7,7 @@ var r20 = /%20/g,
        rheaders = /^(.*?):\s*(.*?)\r?$/mg, // IE leaves an \r character at EOL
        rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
        // #7653, #8125, #8152: local protocol detection
-       rlocalProtocol = /(?:^file|\-extension):$/,
+       rlocalProtocol = /(?:^file|^widget|\-extension):$/,
        rnoContent = /^(?:GET|HEAD)$/,
        rprotocol = /^\/\//,
        rquery = /\?/,
@@ -15,7 +15,7 @@ var r20 = /%20/g,
        rselectTextarea = /^(?:select|textarea)/i,
        rspacesAjax = /\s+/,
        rts = /([?&])_=[^&]*/,
-       rurl = /^(\w+:)\/\/([^\/?#:]+)(?::(\d+))?/,
+       rurl = /^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,
 
        // Keep a copy of the old load method
        _load = jQuery.fn.load,
@@ -113,9 +113,9 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
        for(; i < length && ( executeOnly || !selection ); i++ ) {
                selection = list[ i ]( options, originalOptions, jqXHR );
                // If we got redirected to another dataType
-               // we try there if not done already
+               // we try there if executing only and not done already
                if ( typeof selection === "string" ) {
-                       if ( inspected[ selection ] ) {
+                       if ( !executeOnly || inspected[ selection ] ) {
                                selection = undefined;
                        } else {
                                options.dataTypes.unshift( selection );