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

Fix malformed fallback streaming URL #534

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

Conversation

PattaFeuFeu
Copy link
Owner

Description

A user of the library mentioned in #530 that the streaming fallback URL is malformed in that it doesn’t contain ://, e.g. httpsmastodon.social instead of https://mastodon.social.

This PR ensures that the URL follows URL specifications by using HttpUrl to create a URL.
To not always run the builder, I’ve put it into a lambda that is only called if the fallback URL is actually necessary.

An easier way would be to just write $scheme://$instanceName but I decided against it so that OKHTTP HttpUrl is used on both ends, ensuring compatibility.

Closes #530

Type of Change

  • Bug fix

Breaking Changes

  • None

How Has This Been Tested?

Warning

Not yet tested. I’m currently in the process of writing unit tests for this.

Mandatory Checklist

  • I ran gradle check and there were no errors reported
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • I have added KDoc documentation to all public methods

@PattaFeuFeu PattaFeuFeu self-assigned this Mar 13, 2025
@PattaFeuFeu PattaFeuFeu force-pushed the bugfix/#530/fallback-url-streaming-api-missing-colon-dash branch from 45eac7f to 041f938 Compare March 13, 2025 17:31
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.

Fallback URL for streaming API seems malformed
1 participant