aws / aws/aws-sdk-net

Disable Expect100Continue and how to sub-class S3 Requests

Open
#3,375 1 comment 0 reactions 0 assignees View on GitHub
bug p2 queued s3
Dominant language
C#
Stars
140
Forks
891
Avg merge
21h 51m
Merged PRs (30d)
10

Description

### Discussed in https://github.com/aws/aws-sdk-net/discussions/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:

```
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)
{
}
```

Contributor guide

Open the contributing guide

Research direction

Start with PutObjectRequest and AmazonS3ControlEndpointResolver, then trace how request class names affect S3 request handling and how AfterResponseEvent receives request data. A maintainer decision is needed on disabling Expect100Continue and supported subclassing; done should be an agreed API behavior with coverage for the affected S3 requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, csharp
Domain
api, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.