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

Could golang net package automatically add Expect: 100-continue header if body size > 1024 #39637

Closed
xqzhang2015 opened this issue Jun 17, 2020 · 7 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@xqzhang2015
Copy link

What version of Go are you using (go version)?

go version go1.13.3 linux/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

GO111MODULE=""
GOARCH="amd64"
GOBIN=""

What did you expect to see?

  • C++ libcurl library could automatically add Expect: 100-continue header if body size > 1024. Do golang net package support it?
/* EXPECT_100_THRESHOLD is the request body size limit for when libcurl will
 * automatically add an "Expect: 100-continue" header in HTTP requests. When
 * the size is unknown, it will always add it.
 *
 */
#ifndef EXPECT_100_THRESHOLD
#define EXPECT_100_THRESHOLD 1024
#endif

What did you see instead?

@davecheney
Copy link
Contributor

Adding the header is one thing, the client and the server has to also have expect support.

Expect support was added back in the day when modems were so slow you didn't want to try to send a large request only to find the server hung up 80% of the way through because the request was larger than it permitted.

What is the problem you are trying to solve?

@davecheney davecheney added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 17, 2020
@xqzhang2015
Copy link
Author

@davecheney thanks for the reply.

Not for a specific problem. The main idea is to follow up RFC protocol and conform to most HTTP client libraries, which could help to avoid potential issues for development.

@davecheney
Copy link
Contributor

Thanks for your reply. I’d like to see some analysis on which clients, and more importantly, servers correctly implement expect 100. From my experience the prevalence of expect usage is very low.

@davecheney
Copy link
Contributor

/cc @bradfitz as presumptive owner for a decision.

@bradfitz
Copy link
Contributor

I think this would probably cause more troubles overall. Also, the Request.Body length can be unknown.

@xqzhang2015
Copy link
Author

@davecheney agree with the idea that "the prevalence of expect usage is very low"

@davecheney
Copy link
Contributor

Based on the responses so far I am closing this ticket for now.

@golang golang locked and limited conversation to collaborators Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants