@@ -825,11 +825,12 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
825825 return json . ocs . data
826826 }
827827
828- async sendRequest ( verb :string , relUrl :string , type :string = null , body :any = null , returnRawResponse = false , headers = { } ) :Promise < any > {
828+ async sendRequest ( verb :string , relUrl :string , type :string = null , originalBody :any = null , returnRawResponse = false , headers = { } ) :Promise < any > {
829829 const url = this . normalizeServerURL ( this . server . url ) + relUrl
830830 let res
831831 let timedOut = false
832832
833+ let body = originalBody
833834 if ( type && type . includes ( 'application/json' ) ) {
834835 body = JSON . stringify ( body )
835836 } else if ( type && type . includes ( 'application/x-www-form-urlencoded' ) ) {
@@ -886,10 +887,10 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
886887 throw new RedirectError ( )
887888 }
888889
889- if ( res . status > 400 && res . status !== 423 && authString . startsWith ( 'Bearer' ) ) {
890+ if ( ( res . status === 401 || res . status === 403 || res . status === 404 ) && authString . startsWith ( 'Bearer' ) ) {
890891 this . ticket = null
891892 this . ticketTimestamp = 0
892- return this . sendRequest ( verb , relUrl , type , body , returnRawResponse , headers )
893+ return this . sendRequest ( verb , relUrl , type , originalBody , returnRawResponse , headers )
893894 }
894895
895896 if ( returnRawResponse ) {
@@ -1003,7 +1004,7 @@ export default class NextcloudBookmarksAdapter implements Adapter, BulkImportRes
10031004 throw new RedirectError ( )
10041005 }
10051006
1006- if ( res . status > 400 && res . status !== 423 && authString . startsWith ( 'Bearer' ) ) {
1007+ if ( ( res . status === 401 || res . status === 403 || res . status === 404 ) && authString . startsWith ( 'Bearer' ) ) {
10071008 this . ticket = null
10081009 this . ticketTimestamp = 0
10091010 return this . sendRequestNative ( verb , url , type , body , returnRawResponse , headers )
0 commit comments