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: ability to skip conversion for canonical format #29965

Closed
molecul opened this issue Jan 28, 2019 · 5 comments
Closed

net/textproto: ability to skip conversion for canonical format #29965

molecul opened this issue Jan 28, 2019 · 5 comments
Labels
FeatureRequest FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@molecul
Copy link

molecul commented Jan 28, 2019

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

go version go1.9.4 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
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/projects/go"
GORACE=""
GOROOT="/usr/lib/go-1.9"
GOTOOLDIR="/usr/lib/go-1.9/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build449725707=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

I want to use ReadMIMEHeader() from net/textproto/reader.go for reading headers on ICAP protocol. So I have a trouble with key := canonicalMIMEHeaderKey(kv[:endKey]) (line: 496), because ICAP protocol have a case sensitive headers (for ex: ISTag). Please can you add a new flag-variable to ReadMIMEHeader function for skip canonicalMIMEHeaderKey conversion.

What did you expect to see?

Something like this:
func (r *Reader) ReadMIMEHeader(toCanonical bool) (MIMEHeader, error)
and
if toCanonical == true { key := canonicalMIMEHeaderKey(kv[:endKey]) }

What did you see instead?

func (r *Reader) ReadMIMEHeader() (MIMEHeader, error)
and
key := canonicalMIMEHeaderKey(kv[:endKey])

@bcmills bcmills changed the title net/textproto: Need to have ability for skip convertion for canonical format net/textproto: ability to skip conversion for canonical format Jan 29, 2019
@bcmills
Copy link
Contributor

bcmills commented Jan 29, 2019

because ICAP protocol have a case sensitive headers (for ex: ISTag)

Do you have a reference for the case-sensitivity of those fields? https://tools.ietf.org/html/rfc3507#section-4.3 seems to indicate that they are case-insensitive.

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 29, 2019
@bcmills
Copy link
Contributor

bcmills commented Jan 29, 2019

CC @bradfitz @rsc for net/textproto

@bcmills bcmills added this to the Unplanned milestone Jan 29, 2019
@bradfitz
Copy link
Contributor

I don't think we want to expand this package.

I think it's probably best if you fork it and add whatever you need.

@molecul
Copy link
Author

molecul commented Jan 30, 2019

Thanks for all, I will fork it. But I think that this request can be implemented as another function (for example ReadRawHeader) without using canonicalMIMEHeaderKey method.. I think this will be useful and will not affects existing calls of ReadMIMEHeader method in other modules. I can make pull request if you want.

@ALTree
Copy link
Member

ALTree commented Jun 18, 2021

It seems like the decision here was not to add the feature, and we're not really waiting for any additional information even if this is labelled as waiting for info. I'm closing this, but feel free to comment if I'm wrong.

@ALTree ALTree closed this as completed Jun 18, 2021
@golang golang locked and limited conversation to collaborators Jun 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest 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

5 participants