- Notifications
You must be signed in to change notification settings - Fork20.6k
Adding responseURL to jqXHR#4405
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Thanks for the PR! I added some comments.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
Sorry for the delay. See my latest comments.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
467cea1
to25cee2d
Comparesorry for updating this late. |
xhr.statusText, | ||
// For XHR2 non-text, let the caller handle it (gh-2498) | ||
xhr.statusText, // For XHR2 non-text, let the caller handle it (gh-2498) |
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.
This comment shouldn't have been moved, please move it back below.
errorURL = "http://example.invalid", | ||
redirectAndSuccessURL = url( "mock.php?action=responseURL&url=" + encodeURIComponent( successURL ) ), | ||
redirectAndErrorURL = url( "mock.php?action=responseURL&url=" + encodeURIComponent( errorURL ) ), | ||
jsonpURL = baseURL + "mock.php?action=jsonp&callback=?", |
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.
Is there any reason why this usesbaseURL
directly instead of theurl
function?
@@ -711,7 +711,7 @@ jQuery.extend( { | |||
} | |||
// Callback for when everything is done | |||
function done( status, nativeStatusText, responses, headers ) { | |||
function done( status, nativeStatusText, responses, headers, responseURL ) { |
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.
Unfortunately, this function signature is public API as that's the shape ofcompleteCallback
as described here:https://api.jquery.com/jQuery.ajaxTransport/
This is a new parameter at the end so it's not a breaking change. However, we need to think if this is a good API as 5 unnamed parameters is quite a lot.
(from my comment from#4405 (comment))
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.
FYI: I opened#4634 to make passingresponseURL
possible without adding more positional parameters to this function.
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.
See newest comments.
Adding the "Needs review" label back to discuss#4405 (comment) |
Apart from the existing API:```jsfunction( status, statusText, responses, headers ) {}```a new API is now available:```jsfunction( { status, statusText, responses, headers } ) {}```This makes it possible to add new parameters in the future without relying ontheir order among parameters and being able to provide them selectively.Refjquerygh-4405
Apart from the existing API:```jsfunction( status, statusText, responses, headers ) {}```a new API is now available:```jsfunction( { status, statusText, responses, headers } ) {}```This makes it possible to add new parameters in the future without relying ontheir order among parameters and being able to provide them selectively.Refjquerygh-4405
Closing & re-opening the PR to trigger the EasyCLA check... |
|
Apart from the existing API:```jsfunction( status, statusText, responses, headers ) {}```a new API is now available:```jsfunction( { status, statusText, responses, headers } ) {}```This makes it possible to add new parameters in the future without relying ontheir order among parameters and being able to provide them selectively.Refjquerygh-4405
Apart from the existing API:```jsfunction( status, statusText, responses, headers ) {}```a new API is now available:```jsfunction( { status, statusText, responses, headers } ) {}```This makes it possible to add new parameters in the future without relying ontheir order among parameters and being able to provide them selectively.Refjquerygh-4405
Apart from the existing API:```jsfunction( status, statusText, responses, headers ) {}```a new API is now available:```jsfunction( { status, statusText, responses, headers } ) {}```This makes it possible to add new parameters in the future without relying ontheir order among parameters and being able to provide them selectively.Refjquerygh-4405
Apart from the existing API:```jsfunction( status, statusText, responses, headers ) {}```a new API is now available:```jsfunction( { status, statusText, responses, headers } ) {}```This makes it possible to add new parameters in the future without relying ontheir order among parameters and being able to provide them selectively.Refjquerygh-4405
Apart from the existing API:```jsfunction( status, statusText, responses, headers ) {}```a new API is now available:```jsfunction( { status, statusText, responses, headers } ) {}```This makes it possible to add new parameters in the future without relying ontheir order among parameters and being able to provide them selectively.Refjquerygh-4405
Apart from the existing API:```jsfunction( status, statusText, responses, headers ) {}```a new API is now available:```jsfunction( { status, statusText, responses, headers } ) {}```This makes it possible to add new parameters in the future without relying ontheir order among parameters and being able to provide them selectively.Refjquerygh-4405
Summary
Fixes:#4339
I've taken some references from#1615 (which needed to be resurrected)
original PR was from@xKerman
Since recently support for some browsers was dropped in jquery respective changed were also added.
Please ignore the previous PR (closed already)
Checklist