mirror of
https://github.com/jquery/jquery.git
synced 2026-01-24 02:28:09 -05:00
Fixes #5856. Adds document protocol at the beginning of URLs without protocol (thanks go to skrings for the initial pull request). Simplifies cross-domain detection regexp and logic as a consequence. Also took the opportunity to remove an unused variable. Unit test added.
This commit is contained in:
@@ -415,6 +415,18 @@ test(".ajax() - contentType" , function() {
|
||||
|
||||
});
|
||||
|
||||
test(".ajax() - protocol-less urls", function() {
|
||||
expect(1);
|
||||
|
||||
jQuery.ajax({
|
||||
url: "//somedomain.com",
|
||||
beforeSend: function( xhr, settings ) {
|
||||
equals(settings.url, location.protocol + "//somedomain.com", "Make sure that the protocol is added.");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test(".ajax() - hash", function() {
|
||||
expect(3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user