Commit graph

34 commits

Author SHA1 Message Date
jaubourg a28eadff48 Makes sure no unload handler is bound when not in IE. Also simplifies the whole "on unload abort" code. Also avoids the declaration of yet another variables in the jQuery main closure for the temporary XHR used to assess support properties. 2011-04-21 18:43:40 +02:00
jaubourg 3a3842c669 (Re) Fixes #8884 in a way that keeps the format of the headers map sent to transports natural. 2011-04-19 00:29:20 -07:00
jaubourg a519129e99 Removes now unnecessary regexp and companion function. Fixes some spacing issues. Shortens field names. 2011-04-15 14:16:43 -07:00
Sam Bisbee a9a79ccc6e Continuing to map request headers using their name in uppercase for the index, but we now map to an object with an unmodified name and value: { name: "", value: "" }. This prevents overwriting of the user's supplied headers, which many applications parse with case sensitivity, because we no longer use the modified, uppercase index when building the request. 2011-04-15 16:36:43 -04:00
jaubourg 6c124d3dd4 Fixes #8423. Never set X-Requested-With header automagically for cross-domain requests. 2011-03-07 00:42:09 +01:00
jaubourg ea3e10a492 Minor changes to enforce JQuery Core Style Guidelines. 2011-02-12 00:14:11 +01:00
jaubourg 066304edf0 Adds missing crossDomain test. 2011-02-11 07:39:46 +01:00
jaubourg f2e0ae1a39 Fixes #8245. Ajax now ensures header names are capitalized so that non-compliant xhr implementations don't override them. 2011-02-11 07:07:06 +01:00
jaubourg 3a1d7a3c7c Simplifies status normalization in xhr transport. Local file test modified for clarity. 2011-02-11 07:02:11 +01:00
jaubourg 6f4b36ed17 Replaces jQuery.each loop for headers with a foreach loop. 2011-02-09 17:50:45 +01:00
jaubourg f6e173437e Fixes #8219. Introduces the mimeType option to override content-type header in conversion (and in native xhr when possible). Adds companion overrideMimeType method on jqXHR object (it simply sets the option). Unit test added. 2011-02-09 17:47:33 +01:00
jaubourg 0c21c83e96 Makes sure xhrs are actually aborted on unload in IE. Simplifies active xhrs caching in the process. 2011-02-07 06:11:52 +01:00
jaubourg d6fbbe1080 Fixes #8177. XHR transport now considers 304 Not Modified responses as 200 OK if no conditional request header was provided (as per the XMLHttpRequest specification). 2011-02-05 03:08:35 +01:00
jaubourg 4d808a3345 Don't use a local copy of jQuery.ajaxSettings.isLocal anymore but use the current value so that it is possible to set isLocal to true for protocols unknown to jQuery. 2011-02-03 18:22:37 +01:00
jaubourg ee22a59129 Stores jQuery.ajaxSettings.isLocal locally at load time so that any change to it won't affect the transport. Fixes the url parsing regexp to deal with empty domains. Adds informative text into test/localfile.html and handles Opera's failure. Revises the way xhr are created by doing all tests at load time and normalizes all the xhr creation functions so that none of them may throw an exception. 2011-02-03 06:12:47 +01:00
jaubourg 823eecab90 Fixes #8146. Custom fields in xhrFields are now set after the XMLHttpRequest object has been opened. 2011-02-03 03:02:11 +01:00
jaubourg d77a2a2274 Fixes #8152 by applying the same special cases for protocol "chrome-extension:" as were for "file:" (needs tests). Re-organizes and fixes the handling of special cases for HTTP status code in the xhr transport. Also re-organizes the handling of document.location in ajax.js. 2011-02-03 02:53:10 +01:00
jaubourg 5ef7ddc4c5 Fixes #8146 by introducing the xhrFields option with is a map of fieldName/fieldValue to set on the native xhr. Can be used to set withCredentials to true for cross-domain requests if needed. 2011-02-02 21:16:26 +01:00
jaubourg b90369e8cb Fixes #8135. Makes sure any exception thrown by Firefox when trying to access an XMLHttpRequest property when a network error occured is caught and notified as an error. Added test/networkerror.html to test the behavior. 2011-02-02 13:33:31 +01:00
jaubourg cb85da7b62 Fixes #8125. Status is set to 200 for requests with status 0 when location.protocol if "file:". Added test/localfile.html to control it works. 2011-02-01 17:22:01 +01:00
jaubourg 5ca8f0617f Reworks how values of parameters passed to error callbacks are determined. Fixes #8050. 2011-01-25 16:08:19 +01:00
jaubourg dd5bf42122 Apply JQuery Core Style Guidelines to ajax.js and ajax/*.js, 2011-01-23 05:51:41 +01:00
jaubourg 3dbd600e19 Moves determineResponse logic into main ajax callback. Puts responseXXX fields definitions into ajaxSettings. 2011-01-20 19:40:51 +01:00
jaubourg 8ad2b31ff6 Removes misleading comment. 2011-01-20 18:50:47 +01:00
jaubourg ef86694ada Renames determineDataType as determineResponse. Makes it more generic as a first step into integrating the logic into the main ajax done callback. Also fixes some comments in ajax/xhr.js. 2011-01-20 17:38:21 +01:00
jaubourg 1cecfa1ece Moves determineDataType into ajaxSettings so that it is accessible to transports without the need for a second argument and so that we can now pass the original options to the transport instead. Also ensures the original options are actually propagated to prefilters (they were not). 2011-01-19 18:16:29 +01:00
jaubourg 92c3d87a9c Moved ajaxSettings.xhr definition together with support.ajax and support.cors determination into ajax/xhr.js. 2011-01-19 16:55:26 +01:00
jaubourg a8fa5f2ec1 Moved jQuery.ajax.prefilter and jQuery.ajax.transport to jQuery.ajaxPrefilter and jQuery.ajaxTransport so that proxying the ajax method doesn't turn into a nightmare. Thanks go to scott_gonzalez and DaveMethvin for pointing out the issue. Also made ajaxSetup return "this" to enable chainable definitions -- jQuery.ajaxSetup(...).ajaxPrefilter(...).ajaxTransport(...). 2011-01-13 18:33:24 +01:00
jaubourg 57956152d8 Removed xhr pooling since failing cross-domain requests leaves the xhr object in an undefined state in Firefox. Also rewrote comments related to the active xhr list so that they make sense. 2011-01-13 16:58:16 +01:00
jaubourg 667a3b31e6 Reworked script and xhr abort logic to take advantage of the fact jXHR.abort will complete the request itself if not done already. 2011-01-13 02:05:39 +01:00
jaubourg 1d1d4fe112 Moved unload abort code so that the event is only bound if the xhr transport is used. Fixes #5280. 2011-01-09 22:20:58 +01:00
jaubourg d515068ee8 Fixes #7868. ResponseText is now properly propagated for error callbacks. 2011-01-09 04:53:29 +01:00
jaubourg 98c6c4b2b0 Added a simple cache for xhr objects in the xhr transport. 2011-01-09 04:03:00 +01:00
jaubourg c43b078c69 Renamed src/transports to src/ajax (in case we need prefilters in the future and to avoid a separate prefilters directory). 2011-01-06 01:17:31 +01:00
Renamed from src/transports/xhr.js (Browse further)