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

Response error MethodNotAllowed when s3 put object and custom region endpoint end with '/'. #1700

Open
jmjoy opened this issue Mar 2, 2020 · 0 comments · May be fixed by #1984
Open

Response error MethodNotAllowed when s3 put object and custom region endpoint end with '/'. #1700

jmjoy opened this issue Mar 2, 2020 · 0 comments · May be fixed by #1984

Comments

@jmjoy
Copy link

jmjoy commented Mar 2, 2020

The failed code:

let region = Region::Custom {
    name: "".to_string(),
    endpoint: "http://xxx/".to_string(), // end with '/'
};
let http_client = HttpClient::new()?;
let s3client = S3Client::new_with(http_client, provider, region);


let request = PutObjectRequest {
    // ...
    ..Default::default()
};

self.s3client.put_object(request).await?;

Will result the error:

"<?xml version=\"1.0\" encoding=\"UTF-8\"?><Error><Code>MethodNotAllowed</Code><RequestId>……</RequestId><HostId>……</HostId></Error>

If remove the slash of region.endpoint, such as http://xxx, it is ok.

Could it better to compatible with this situation, or make an error when creating the custom region?

@xDarksome xDarksome linked a pull request Jun 3, 2022 that will close this issue
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 a pull request may close this issue.

1 participant