refacto: encode url with components becuase of / in base 64
All checks were successful
repod / xml (push) Successful in 17s
repod / php (push) Successful in 1m0s
repod / nodejs (push) Successful in 2m18s
repod / release (push) Has been skipped

This commit is contained in:
Michel Roux 2024-01-11 21:41:37 +01:00
parent af30767ab6
commit 0bbe6dbf24
8 changed files with 18 additions and 7 deletions

View File

@ -12,6 +12,7 @@
<script>
import { NcAppNavigationNewItem } from '@nextcloud/vue'
import Plus from 'vue-material-design-icons/Plus.vue'
import { encodeUrl } from '../../utils/url.js'
export default {
name: 'AddRss',
@ -21,7 +22,7 @@ export default {
},
methods: {
addSubscription(feedUrl) {
this.$router.push(btoa(feedUrl))
this.$router.push(encodeUrl(feedUrl))
},
},
}

View File

@ -26,6 +26,7 @@ import AdaptativeList from '../Atoms/AdaptativeList.vue'
import Loading from '../Atoms/Loading.vue'
import axios from '@nextcloud/axios'
import { debounce } from '../../utils/debounce.js'
import { encodeUrl } from '../../utils/url.js'
import { generateUrl } from '@nextcloud/router'
import moment from '@nextcloud/moment'
import { showError } from '@nextcloud/dialogs'
@ -75,7 +76,7 @@ export default {
}
}, 200),
toUrl(url) {
return `/${btoa(url)}`
return `/${encodeUrl(url)}`
},
},
}

View File

@ -5,6 +5,8 @@
</template>
<script>
import { encodeUrl } from '../../utils/url.js'
export default {
name: 'TopItem',
props: {
@ -27,7 +29,7 @@ export default {
},
computed: {
toUrl() {
return `/${btoa(this.link)}`
return `/${encodeUrl(this.link)}`
},
},
}

View File

@ -34,6 +34,7 @@
import { NcAppNavigationNew, NcAvatar } from '@nextcloud/vue'
import Plus from 'vue-material-design-icons/Plus.vue'
import axios from '@nextcloud/axios'
import { decodeUrl } from '../../utils/url.js'
import { generateUrl } from '@nextcloud/router'
import { showError } from '@nextcloud/dialogs'
@ -68,7 +69,7 @@ export default {
},
computed: {
url() {
return atob(this.$route.params.url)
return decodeUrl(this.$route.params.url)
},
isSubscribed() {
return this.$store.state.subscriptions.subscriptions.includes(this.url)

View File

@ -55,6 +55,7 @@ import Modal from './Modal.vue'
import PlayButton from 'vue-material-design-icons/Play.vue'
import StopButton from 'vue-material-design-icons/Stop.vue'
import axios from '@nextcloud/axios'
import { decodeUrl } from '../../utils/url.js'
import { formatTimer } from '../../utils/time.js'
import { generateUrl } from '@nextcloud/router'
import moment from '@nextcloud/moment'
@ -85,7 +86,7 @@ export default {
return this.$store.state.player.episode
},
url() {
return atob(this.$route.params.url)
return decodeUrl(this.$route.params.url)
},
},
async mounted() {

View File

@ -10,6 +10,8 @@
</template>
<script>
import { encodeUrl } from '../../utils/url.js'
export default {
name: 'Infos',
computed: {
@ -19,7 +21,7 @@ export default {
},
methods: {
toUrl(url) {
return `/${btoa(url)}`
return `/${encodeUrl(url)}`
},
},
}

View File

@ -25,6 +25,7 @@ import { NcActionButton, NcAppNavigationItem, NcAvatar } from '@nextcloud/vue'
import Alert from 'vue-material-design-icons/Alert.vue'
import Delete from 'vue-material-design-icons/Delete.vue'
import axios from '@nextcloud/axios'
import { encodeUrl } from '../../utils/url.js'
import { generateUrl } from '@nextcloud/router'
import { showError } from '@nextcloud/dialogs'
@ -52,7 +53,7 @@ export default {
},
computed: {
toUrl() {
return `/${btoa(this.url)}`
return `/${encodeUrl(this.url)}`
},
},
async mounted() {

2
src/utils/url.js Normal file
View File

@ -0,0 +1,2 @@
export const encodeUrl = (url) => encodeURIComponent(btoa(url))
export const decodeUrl = (url) => atob(decodeURIComponent(url))