Skip to content

Ajax: Make responseJSON work for erroneous same-domain JSONP requests #4778

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

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

mgol
Copy link
Member

@mgol mgol commented Aug 26, 2020

Summary

Don't use a script tag for JSONP requests unless for cross-domain requests
or if scriptAttrs are provided. This makes the responseJSON property available
in JSONP error callbacks.

This fixes a regression from jQuery 3.5.0 introduced in gh-4379 which made
erroneous script responses to not be executed to follow native behavior.

The 3.x-stable branch doesn't need this fix as it doesn't use script tags for
regular async requests.

Ref gh-4771
Ref gh-4773
Ref gh-4379

+6 bytes

Checklist

Sorry, something went wrong.

Don't use a script tag for JSONP requests unless for cross-domain requests
or if scriptAttrs are provided. This makes the `responseJSON` property available
in JSONP error callbacks.

This fixes a regression from jQuery 3.5.0 introduced in jquerygh-4379 which made
erroneous script responses to not be executed to follow native behavior.

The 3.x-stable branch doesn't need this fix as it doesn't use script tags for
regular async requests.

Ref jquerygh-4771
Ref jquerygh-4773
Ref jquerygh-4379
@mgol mgol added this to the 4.0.0 milestone Aug 26, 2020
@mgol mgol self-assigned this Aug 26, 2020
@mgol mgol added Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. Needs review labels Aug 26, 2020
@timmywil timmywil removed the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Aug 31, 2020
@mgol mgol removed the Needs review label Aug 31, 2020
@mgol mgol merged commit 68b4ec5 into jquery:master Aug 31, 2020
@mgol mgol deleted the mgol-jsonp-error branch August 31, 2020 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants