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
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOVCS=
set GOVERSION=go1.22.7
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
What did you do?
The http.NewRequest method, which internally calls NewRequestWithContext, includes validation for the HTTP method used. However, I have verified that it accepts any string and does not return any error.
Go version
go version go1.22.7 windows/amd64
Output of
go env
in your module/workspace:What did you do?
The http.NewRequest method, which internally calls NewRequestWithContext, includes validation for the HTTP method used. However, I have verified that it accepts any string and does not return any error.
this method is not working fine:
here you have a test to check it out:
What did you see happen?
=== RUN TestNewRequest
go_issue_test.go:14: nil
--- PASS: TestNewRequest (0.00s)
PASS
Process finished with the exit code 0
What did you expect to see?
I expected to receive something like
"net/http: invalid method INVALID-METHOD."
The text was updated successfully, but these errors were encountered: