New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ajax: Don't process data property on no-entity-body requests #3781
Conversation
@dmethvin, thanks for your PR! By analyzing the history of the files in this pull request, we identified @markelog, @jaubourg and @gibson042 to be potential reviewers. |
👎 see my comment on the issue (and sorry to be late to the party) |
I'm still in favor of this change, but I observed while combing through the code that modifying an ajax URL in P.S. It's great to see you here, @jaubourg. And you're not late at all. |
Hey @gibson042, nice to see you too :) |
What @jaubourg said makes sense to me. It's not that the data should be ignored, it's that it should not be processed. It should still get used if passed. Otherwise, why pass it a GET request at all? Also, I don't see a use case for passing a non string in a |
This is my interpretation of desired behavior as discussed in the meeting. It should be implemented in this PR and documented in https://github.com/jquery/api.jquery.com/blob/master/entries/jQuery.ajax.xml#L145 .
|
}; | ||
} ); | ||
|
||
ajaxTest( "jQuery.ajax() - data - process string with GET", 2, function( assert ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation?
Fixes gh-3438
Summary
The description in gh-3438 is pretty detailed. Basically, don't process
settings.data
ifsettings.processData
isfalse
. This allows asettings.beforeSend
hook to have its way with the original data and, for example, serialize it to JSON on the URL.I'd consider this a long-standing bug and the current documentation would imply it should have worked this way all along. It should be safe to include in a minor release.
Checklist