mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-15 14:11:03 +00:00
Update http.js
This commit is contained in:
parent
d366427b62
commit
3a565759be
|
@ -228,7 +228,6 @@ var HTTPObject = function(engine) {
|
||||||
|
|
||||||
this.setUserAgent = function(agent) {
|
this.setUserAgent = function(agent) {
|
||||||
this.userAgent = agent;
|
this.userAgent = agent;
|
||||||
this.setHeader("User-Agent", this.userAgent);
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -290,7 +289,8 @@ var HTTPObject = function(engine) {
|
||||||
var url = this.serializeParameters(url);
|
var url = this.serializeParameters(url);
|
||||||
|
|
||||||
this.setMethod(method.toUpperCase()); // set method
|
this.setMethod(method.toUpperCase()); // set method
|
||||||
this.pushState(null, null, url); // push state
|
this.pushState(null, null, url); // push stat
|
||||||
|
this.setHeader("User-Agent", (this.userAgent != null ? this.userAgent : "")); // set user agent
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (this.engine == "MSXML") {
|
if (this.engine == "MSXML") {
|
||||||
|
@ -365,10 +365,8 @@ var HTTPObject = function(engine) {
|
||||||
cmd.push(this.cookie);
|
cmd.push(this.cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.userAgent != null) {
|
|
||||||
cmd.push("-A");
|
cmd.push("-A");
|
||||||
cmd.push(this.userAgent);
|
cmd.push((this.userAgent != null ? this.userAgent : ''));
|
||||||
}
|
|
||||||
|
|
||||||
var pos = url.indexOf('?');
|
var pos = url.indexOf('?');
|
||||||
if (pos > -1) {
|
if (pos > -1) {
|
||||||
|
@ -477,7 +475,6 @@ var HTTPObject = function(engine) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.create();
|
this.create();
|
||||||
this.setUserAgent(this.userAgent);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.create = function(engine) {
|
exports.create = function(engine) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user