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 FilesService.Upload #5

Closed
wants to merge 1 commit into from
Closed

Fix FilesService.Upload #5

wants to merge 1 commit into from

Conversation

michaelfeinbier
Copy link

Hey there,
in this GitRepo you do not have the "Issues" activated to report a potential bug so I tried to investigate myself.

For me, the FilesService.Upload does not work correctly.

putio error. code:404 type:"" message:"" request:POST https://upload.put.io

After investigating, I found out that according to the API specifications of putio the Endpoint to upload should be https://upload.put.io/v2/files/upload instead of just https://upload.put.io. This is what the code is doing. Until now, we're using a weird placeholder $upload$ to override the hostname. I improved the logic, made clearer what is happening and added tests to the client

I did not touch the logic of func (u *UploadService) CreateUpload( this uses a weird placeholder as well. I do not know where this endpoint is reflected in V2 at all, so I kept the logic as is here

@cenkalti
Copy link
Member

Hi @michaelfeinbier . Thanks for reporting this and your contribution. I've fixed this issue by just changing the upload URL with this commit: 873b1f4

Please let me know if it does not resolve your problem.

@cenkalti cenkalti closed this Sep 16, 2023
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.

2 participants