fix webdav http code
This commit is contained in:
@@ -282,12 +282,6 @@
|
|||||||
url[url.length - 1] !== '/' && (url += '/')
|
url[url.length - 1] !== '/' && (url += '/')
|
||||||
const username = this.pluginInputs['username'].val().trim()
|
const username = this.pluginInputs['username'].val().trim()
|
||||||
const password = this.pluginInputs['password'].val().trim()
|
const password = this.pluginInputs['password'].val().trim()
|
||||||
const methodDict = {
|
|
||||||
PROPFIND: 207,
|
|
||||||
GET: 200,
|
|
||||||
PUT: 201,
|
|
||||||
DELETE: 204
|
|
||||||
}
|
|
||||||
this.buttons.forEach(button => button.$el.attr('disabled', true))
|
this.buttons.forEach(button => button.$el.attr('disabled', true))
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
GM_xmlhttpRequest({
|
GM_xmlhttpRequest({
|
||||||
@@ -301,7 +295,7 @@
|
|||||||
...config,
|
...config,
|
||||||
onload: response => {
|
onload: response => {
|
||||||
this.buttons.forEach(button => button.$el.removeAttr('disabled'))
|
this.buttons.forEach(button => button.$el.removeAttr('disabled'))
|
||||||
if (response.status === methodDict[method]) {
|
if (response.status>=200&&response.status<300) {
|
||||||
resolve(response)
|
resolve(response)
|
||||||
} else {
|
} else {
|
||||||
if (method == 'GET' && response.status == 404) {
|
if (method == 'GET' && response.status == 404) {
|
||||||
|
|||||||
Reference in New Issue
Block a user