You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by DetlefGolze June 26, 2024
I want to disable the Expect100Continue header and thought that it is as easy as creating a derived class of PutObjectRequest which already has an overridable property for this:
public partial class MyPutObjectRequest : PutObjectRequest
{
public MyPutObjectRequest()
{
// This is the default setting in base library
//
MyExpect100Continue = true;
}
public bool MyExpect100Continue { get; set; }
protected override bool Expect100Continue
{ get { return MyExpect100Continue; } }
}
So far so good. This compiles and appears to do what I expect. However, the AmazonS3ControlEndpointResolver uses the name of the request class to implement some request specific behavior causing requests to fail which use an unknown type.
So, two questions:
Is there a better way to disable Expect100Continue? I suppose it is not used as intended anyway and only generates overhead.
Is there an official way to create sub-classes of Request classes? Except of the above example I was hoping that I can use this to pass data from and to an AfterResponseEvent. My S3Client is shared by many threads and this would make life much easier.
We could add a request property which returns the expected RequestName or just use something like this in AmazonS3ControlEndpointResolver:
if (request is PutObjectRequest)
{
}
The text was updated successfully, but these errors were encountered:
Hi, just want to add my findings if it helps someone.
Had the same problem as @DetlefGolze trying to disable Expect100Continue. Then I saw his findings about the class name causing issues. So I tried naming the derived class PutObjectRequest and it works!
public class PutObjectRequest : Amazon.S3.Model.PutObjectRequest { protected override bool Expect100Continue => false; }
Ps. My use case is that I'm calling a "compatible" non-AWS-S3 backend that doesn't support the Expect: 100-Continue header which causes a 1 sec delay. I'm using .NET 8.
Discussed in #3356
Originally posted by DetlefGolze June 26, 2024
I want to disable the Expect100Continue header and thought that it is as easy as creating a derived class of PutObjectRequest which already has an overridable property for this:
So far so good. This compiles and appears to do what I expect. However, the AmazonS3ControlEndpointResolver uses the name of the request class to implement some request specific behavior causing requests to fail which use an unknown type.
So, two questions:
Is there a better way to disable Expect100Continue? I suppose it is not used as intended anyway and only generates overhead.
Is there an official way to create sub-classes of Request classes? Except of the above example I was hoping that I can use this to pass data from and to an AfterResponseEvent. My S3Client is shared by many threads and this would make life much easier.
We could add a request property which returns the expected RequestName or just use something like this in AmazonS3ControlEndpointResolver:
The text was updated successfully, but these errors were encountered: