Merge pull request #1 from nulIptr/patch-1

fix webdav http code
This commit is contained in:
2024-08-12 10:52:31 +08:00
committed by GitHub

View File

@@ -282,12 +282,6 @@
url[url.length - 1] !== '/' && (url += '/')
const username = this.pluginInputs['username'].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))
return new Promise((resolve, reject) => {
GM_xmlhttpRequest({
@@ -301,7 +295,7 @@
...config,
onload: response => {
this.buttons.forEach(button => button.$el.removeAttr('disabled'))
if (response.status === methodDict[method]) {
if (response.status>=200&&response.status<300) {
resolve(response)
} else {
if (method == 'GET' && response.status == 404) {