Update http.js

This commit is contained in:
Namhyeon Go 2022-04-20 14:02:11 +09:00 committed by GitHub
parent 3ff0e41e0d
commit d66101db7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ var HTTPObject = function(engine) {
this.headers = {};
this.parameters = {};
this.dataType = null;
this.userAgent = "WelsonJS/0.1.4-dev (https://github.com/gnh1201/welsonjs)";
this.userAgent = "WelsonJS/0.2.3-dev (https://github.com/gnh1201/welsonjs)";
this.isAsync = false;
this.proxy = {
"enabled": false,
@ -48,6 +48,7 @@ var HTTPObject = function(engine) {
password: ""
};
this.isFollowRedirect = true;
this.saveTo = '';
this.create = function() {
if (this.engine == "MSXML") {
@ -454,6 +455,11 @@ var HTTPObject = function(engine) {
}
}
// if it is download
cmd.push("-o");
cmd.push(this.saveTo);
// set the URL
cmd.push(state.url);
// Get response text
@ -632,6 +638,10 @@ var HTTPObject = function(engine) {
return this;
};
this.setSaveTo = function(filename) {
this.saveTo = filename;
};
this.create();
};