-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http: has a bug of deal with http request when its length is bigger than 4096 bytes #44062
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
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Comments
Try curl -v |
can't repro package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"os"
"os/exec"
"strings"
"time"
)
func main() {
http.HandleFunc("/", func(rw http.ResponseWriter, r *http.Request) {
b, err := httputil.DumpRequest(r, false)
if err != nil {
log.Fatal("dump err:", err)
}
fmt.Println(string(b))
rw.Write([]byte("ok"))
})
go http.ListenAndServe(":8080", nil)
time.Sleep(1 * time.Second)
cmd := exec.Command("curl", "http://127.0.0.1:8080/a="+strings.Repeat("b", 4097))
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
fmt.Println(cmd.Run())
} output:
|
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
Yeah I try again and it doesn't appear again |
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.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
http.go:
go run http.go
curl http://127.0.0.1/a=1321dsfdj123414dsfsf321321nlkfdsfdsflewrpwokofdfsd...
make sure the url is longer than 4096 bytes when use wireshark capture the flow. AND THEN you won't get the response
What did you expect to see?
"hello-world"
What did you see instead?
nothing
The text was updated successfully, but these errors were encountered: