You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The path prefix to "api/v1" is currently hardcoded in MastodonClient.kt. This will be problematic once V2 endpoints need to be added, but is already an issue for the OAuth endpoints that aren't located under "/api".
The current workaround is to offer a separate postUrl(String, Parameter) method that interprets its string input as a full URL, whereas post(String, Parameter) interprets its input as additional path segments under "api/v1". Both the fact that the two methods have an identical signature and the fact that there's no check on whether the full URL even uses the same host as defined as instanceName can lead to issues down the line.
This could be solved by moving the full path to each endpoint out of MastodonClient and into each of its callers. At the same time, building the final URLs can be moved from doing it ourselves to using okHttp.HttpUrl and its builder throughout, which might prevent more bugs from happening.
I'm already working on the OkHttp part of #5, so I could tackle this in the process.
The text was updated successfully, but these errors were encountered:
The path prefix to "api/v1" is currently hardcoded in MastodonClient.kt. This will be problematic once V2 endpoints need to be added, but is already an issue for the OAuth endpoints that aren't located under "/api".
The current workaround is to offer a separate
postUrl(String, Parameter)
method that interprets its string input as a full URL, whereaspost(String, Parameter)
interprets its input as additional path segments under "api/v1". Both the fact that the two methods have an identical signature and the fact that there's no check on whether the full URL even uses the same host as defined asinstanceName
can lead to issues down the line.This could be solved by moving the full path to each endpoint out of MastodonClient and into each of its callers. At the same time, building the final URLs can be moved from doing it ourselves to using
okHttp.HttpUrl
and its builder throughout, which might prevent more bugs from happening.I'm already working on the OkHttp part of #5, so I could tackle this in the process.
The text was updated successfully, but these errors were encountered: