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

net/textproto: can write binary header it can't read #60674

Open
Jorropo opened this issue Jun 8, 2023 · 1 comment
Open

net/textproto: can write binary header it can't read #60674

Jorropo opened this issue Jun 8, 2023 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@Jorropo
Copy link
Member

Jorropo commented Jun 8, 2023

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

$ go version
go version go1.20.5 linux/amd64

Does this issue reproduce with the latest release?

  • b9baf44 (latest tip) yes
  • 1.20.5 (latest release) yes
  • 1.19.10 (latest previous release) no

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/hugo/.cache/go-build"
GOENV="/home/hugo/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/hugo/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/hugo/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/hugo/Documents/Scripts/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/hugo/Documents/Scripts/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.5"
GCCGO="gccgo"
GOAMD64="v3"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/hugo/Documents/Scripts/go/src/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4234151944=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Run https://go.dev/play/p/f3mNQX8WQf6.

What did you expect to see?

Hello, 世界

What did you see instead?

panic: malformed MIME header line: Test: this is a header � containing binary

goroutine 1 [running]:
main.main()
	/tmp/sandbox1871938318/prog.go:39 +0x2b7

git bisect

I bisected the issue a6642e6.

RFC 7230

I get that my original code was buggy given RFC 7230 however it was working fine before and isn't anymore which is a breaking change, that why I am raising the issue here.
If you maintainers decide this is a WONTFIX, at least we should convert this issue to something along the lines of net/textproto, mime/multipart: should error when writing invalid part header, it is not normal that I can write thoses broken headers but not read them, if anything this should be consistent.

@Jorropo Jorropo changed the title net/textproto&mime/mimepart: 1.20 regression malformed MIME header line when trying to decode part for binary data in header net/textproto, mime/mimepart: 1.20 regression malformed MIME header line when trying to decode part for binary data in header Jun 8, 2023
@Jorropo Jorropo changed the title net/textproto, mime/mimepart: 1.20 regression malformed MIME header line when trying to decode part for binary data in header net/textproto, mime/multipart: 1.20 regression malformed MIME header line when trying to decode part for binary data in header Jun 8, 2023
@seankhliao seankhliao changed the title net/textproto, mime/multipart: 1.20 regression malformed MIME header line when trying to decode part for binary data in header net/textproto: can write binary header it can't read Jun 8, 2023
@seankhliao
Copy link
Member

cc @neild

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants