Skip to content

Fix for servers responding partial URLs#81

Open
YDX-2147483647 wants to merge 2 commits intotimvisee:masterfrom
YDX-2147483647:url-parse
Open

Fix for servers responding partial URLs#81
YDX-2147483647 wants to merge 2 commits intotimvisee:masterfrom
YDX-2147483647:url-parse

Conversation

@YDX-2147483647
Copy link
Copy Markdown
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
Copy Markdown
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