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 for servers responding partial URLs #81

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

Conversation

YDX-2147483647
Copy link
Contributor

@YDX-2147483647 YDX-2147483647 commented Aug 27, 2023

Some Send server responds with a URL without scheme. Therefore, Url::parse(&self.url) fails. This PR adds a fallback for this case.

Fixes timvisee/ffsend#159

Remarks: If you want to mimic a server like this, you can insert the following codes before this line.

https://github.com/YDX-2147483647/ffsend-api/blob/35ec2f80f98e190e22cc687b75fde8d3c99ff48d/src/action/upload.rs#L357

        let upload_response = UploadResponse {
            url: upload_response
                .url
                .strip_prefix("https://")
                .unwrap()
                .to_string(),
            id: upload_response.id,
            owner_token: upload_response.owner_token,
        };

@YDX-2147483647
Copy link
Contributor Author

I notice that you might prefer GitLab, so I make a copy to https://gitlab.com/timvisee/ffsend-api/-/merge_requests/7.

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.

Unable to upload
1 participant