Skip to content

Commit

Permalink
Makes it so a prefilter can change the type of a request.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaubourg committed Jan 16, 2011
1 parent 21143c3 commit 914aa3d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ajax.js
Expand Up @@ -584,12 +584,6 @@ jQuery.extend({
// Remove hash character (#7531: and string promotion)
s.url = ( "" + s.url ).replace( rhash , "" );

// Uppercase the type
s.type = s.type.toUpperCase();

// Determine if request has content
s.hasContent = ! rnoContent.test( s.type );

// Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( /\s+/ );

Expand All @@ -605,13 +599,19 @@ jQuery.extend({
}

// Convert data if not already a string
if ( s.data && s.processData && typeof s.data != "string" ) {
if ( s.data && s.processData && typeof s.data !== "string" ) {
s.data = jQuery.param( s.data , s.traditional );
}

// Apply prefilters
jQuery.ajaxPrefilter( s , options );

// Uppercase the type
s.type = s.type.toUpperCase();

// Determine if request has content
s.hasContent = ! rnoContent.test( s.type );

// Watch for a new set of requests
if ( s.global && jQuery.active++ === 0 ) {
jQuery.event.trigger( "ajaxStart" );
Expand Down

0 comments on commit 914aa3d

Please sign in to comment.