Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure server URL always ends with '/' #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Make sure server URL always ends with '/' #7

wants to merge 3 commits into from

Conversation

bonukai
Copy link
Contributor

@bonukai bonukai commented Oct 5, 2021

No description provided.

@KodeStar
Copy link
Owner

KodeStar commented Oct 5, 2021

Might be helpful to add a comment on why this will work better.

@bonukai
Copy link
Contributor Author

bonukai commented Oct 5, 2021

@KodeStar
I do not know much about Vue.js, but from what I can see, server URL is set here:

set (value) {
this.$store.commit('app/server', value)
}
which in turn will call mutation here:
export function server (state, data) {
state.server = data
}

If we add '/' there, then we can always assume, that state.server ends with '/' and we can join paths with '+' in those places:

url = new URL(book.collection + '/', state.server).href

url = new URL(state.currentCollection + '/', state.server).href

fetch(data.server + 'authenticate', {

My previous pull request did not realy fix it, it's still not possible to use URL without forward slash at the end, app will try to connect to https://audioserve.zderadicka.euauthenticate/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants