Ajax: Add the responseURL field to jqXHR#5826
Merged
Merged
Conversation
Expose `xhr.responseURL` (the final URL after redirects, including any redirects followed by the browser) as `jqXHR.responseURL`. The XHR transport passes it through the object-form `completeCallback` introduced in jquerygh-4634, so the positional signature stays untouched. Following the existing `responseText`/`responseXML`/`responseJSON` pattern, `jqXHR.responseURL` is only set when a transport reports it. As a result: * modern-browser XHR: the final URL string * IE 11 XHR: `undefined` (no native support) * script / JSONP / aborted requests: `undefined` (transport has no way to know the URL) A reusable `redirect` mock action has been added to both the Node middleware and `mock.php` so the redirect path can be exercised. Fixes jquerygh-4339 Ref jquerygh-4634 Ref jquerygh-5793
This was referenced Apr 21, 2026
gibson042
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose
xhr.responseURL(the final URL after redirects, including any redirects followed by the browser) asjqXHR.responseURL. The XHR transport passes it through the object-formcompleteCallbackintroduced in gh-4634, so the positional signature stays untouched.Following the existing
responseText/responseXML/responseJSONpattern,jqXHR.responseURLis only set when a transport reports it. As a result:undefined(no native support)undefined(transport has no way to know the URL)A reusable
redirectmock action has been added to both the Node middleware andmock.phpso the redirect path can be exercised.Fixes gh-4339
Ref gh-4634
Ref gh-5793
Checklist