tomboy.osx
tomboy.osx copied to clipboard
Correctly generate sync server API url
tomboy.osx uses the given sync server URL, adds api/1.0 and sends a request to that location:
tomboy-library/Tomboy-library/Tomboy/Sync/WebSync/OAuth/OAuthConnection.cs
91: apiRoot = rest_client.Get<ApiResponse> (rootUrl+ "api/1.0/");
All other clients at least add a slash between the root URL and api, so that URLs like
http://example.org/sync get an API URL of http://example.org/sync/api/1.0/. Some other clients do not work when giving the root url without slash.
Currently I would have to give users two instructions in grauphel: One URL that works with tomboy.osx, and one that works with all other clients.
Please make the API URL generation a bit smarter by adding a / after rootUrl if it does not end with one.
So that the user can input an URL with or without a slash, and tomboy.osx automatically does the right thing:
http://example.org/sync->http://example.org/sync/api/1.0/http://example.org/sync/->http://example.org/sync/api/1.0/
There are two places that build the URL, and both are doing it differently:
Tomboy-library/Tomboy/Sync/WebSync/WebSyncServer.cs:rootApiUrl = serverUrl + "/api/1.0"
Tomboy-library/Tomboy/Sync/WebSync/OAuth/OAuthConnection.cs:apiRoot = rest_client.Get<ApiResponse> (rootUrl+ "api/1.0/");
I think the best way would be to add a slash at the end of the serverUrl if it does not have one, and then always only add api/1.0 without a leading slash.
that shouldn't be too hard.
@trepidity - You made the changes for this and pushed out a packaged file. Can you push the changes to the repository? Thanks
Hi, is this issue resolved? Sync to grauphel does not work for me too. Probably the root is this issue. Tomboy.osx running on mac os 10.11.1.