mikifus / padland

Padland is a tool to manage, share, remember and read collaborative documents based on the Etherpad technology in Android.
Apache License 2.0
62 stars 15 forks source link

Doubled slash in custom pad urls, if server url has a trailing slash #35

Closed HairyFotr closed 7 years ago

HairyFotr commented 7 years ago

Reproduction: If a trailing slash / is written by the user in the custom server url field (for example http://mypadserver.com/ (is not a real etherpad site)), padland will generate pad urls such as http://mypadserver.com//p/some-pad, with two slashes, which fails to load properly.

Fix suggestion: padland should not add an extra / if the url already ends with it.

(And btw thanks for a great app!)

HairyFotr commented 7 years ago

Additionally, the existing pad urls are not updated when I change the server url - I need to re-add the pads manually.

mikifus commented 7 years ago

Hi, thank you for your feedback.

I've solved the trailing slash bug (a new branch) but I have some concerns regarding the update function.

The already created pads are saved by name and url, but not the server_id. Also the default servers have no ID, it will conflict with the custom ones. This is the simplest approach. Updating all the urls may be done by looking for url matches with the old one, which can lead to glitches, so I am not sure about that method. Do you have any proposal?

HairyFotr commented 7 years ago

Thanks! I had a feeling it might be implemented this way. I think it's not a big problem if it stays like it is - for incorrect server urls you notice when adding the first pad, and server domain moves (which would require readding multiple pads) are probably rare.

mikifus commented 7 years ago

Ok, I had that same view, when I tried to think on a good solution It required too deep structural changes.

Please, try out this beta release and tell me if it does work as you expected: https://github.com/mikifus/padland/releases/tag/v1.3.5-beta