Backport bugfix from 0.7.1
This commit is contained in:
parent
5e7f079b43
commit
8f33fa7689
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Typertext",
|
||||
"version": "0.6.1",
|
||||
"version": "0.6.2",
|
||||
"homepage": "https://github.com/terribleplan/Typertext",
|
||||
"authors": [
|
||||
"Kegan Myers <kegan@keganmyers.com>"
|
||||
|
|
|
@ -107,7 +107,7 @@ declare module Typertext.Http {
|
|||
public GetPort(): number;
|
||||
public GetDomain(): string;
|
||||
public GetProtocol(): HttpProtocol;
|
||||
public CrossOriginCheck(url: HttpUrl): boolean;
|
||||
public SameOriginCheck(url: HttpUrl): boolean;
|
||||
}
|
||||
}
|
||||
declare module Typertext.Json {
|
||||
|
|
|
@ -266,7 +266,7 @@ var Typertext;
|
|||
return this.protocol;
|
||||
};
|
||||
|
||||
HttpUrl.prototype.CrossOriginCheck = function (url) {
|
||||
HttpUrl.prototype.SameOriginCheck = function (url) {
|
||||
return (this.domain === url.GetDomain() && this.port === url.GetPort() && this.protocol === url.GetProtocol());
|
||||
};
|
||||
return HttpUrl;
|
||||
|
@ -399,7 +399,7 @@ var Typertext;
|
|||
var ieLte9 = (ieTestDiv.getElementsByTagName("i").length === 1);
|
||||
var origin = HttpUrl.FromUrl(window.location.href);
|
||||
|
||||
if (!origin.CrossOriginCheck(origin) || !ieLte9) {
|
||||
if (origin.SameOriginCheck(origin) || !ieLte9) {
|
||||
return new Typertext.Transport.XHR(method, request, postData, callback);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -199,7 +199,7 @@ module Typertext.Http {
|
|||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
public CrossOriginCheck(url:HttpUrl):boolean {
|
||||
public SameOriginCheck(url:HttpUrl):boolean {
|
||||
return (this.domain === url.GetDomain() && this.port === url.GetPort() && this.protocol === url.GetProtocol());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ module Typertext.Transport {
|
|||
var origin = HttpUrl.FromUrl(window.location.href);
|
||||
|
||||
//If this is a CORS request in a modern browser
|
||||
if (!origin.CrossOriginCheck(origin) || !ieLte9) {
|
||||
if (origin.SameOriginCheck(origin) || !ieLte9) {
|
||||
//Just use a standard XHR request
|
||||
return new XHR(method, request, postData, callback);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"type": "git",
|
||||
"url": "https://github.com/terribleplan/Typertext.git"
|
||||
},
|
||||
"version": "0.6.1",
|
||||
"version": "0.6.2",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.2",
|
||||
"grunt-cli": "~0.1.13",
|
||||
|
|
Reference in New Issue