Skip to content

net/http: has a bug of deal with http request when its length is bigger than 4096 bytes #44062

Closed
@keeplook4ever

Description

@keeplook4ever

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

$ go version
go version go1.15.6 linux/amd64

Does this issue reproduce with the latest release?

Yes.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/saicops/.cache/go-build"
GOENV="/home/saicops/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/saicops/.go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/saicops/.go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/opt/soft_ln/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/soft_ln/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build006094992=/tmp/go-build -gno-record-gcc-switches"

What did you do?

http.go:

package main

import (
  "fmt"
  "net/http"
)

func HelloHandler(w http.ResponseWriter, r *http.Request) {
   fmt.Fprintf(w, "hello-world")
}

func main() {
    http.HandleFunc("/", HelloHandler)
    http.ListenAndServe("0.0.0.0:9999", nil)

}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions