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

x/net/http/httpguts: add parser/accessors for Link header #31609

Open
arnottcr opened this issue Apr 22, 2019 · 4 comments

Comments

@arnottcr
Copy link

commented Apr 22, 2019

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

$ go version
go version go1.12.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=""
GOCACHE="/home/user/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
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-build550614768=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I am consuming an API that implements pagination via the link header, see RFC5988.

What did you expect to see?

I hoped that the std lib would have implemented a parser for this bespoke syntax. This could even be done lazily to prevent overhead.

What did you see instead?

I was forced to grab a 3rd party library (e.g. github.com/deiu/linkheader, github.com/tomnomnom/linkheader), or implement the parser myself.

@julieqiu

This comment has been minimized.

Copy link

commented Apr 22, 2019

/cc @bradfitz

@bradfitz

This comment has been minimized.

Copy link
Member

commented Apr 22, 2019

net/http doesn't aim to be everything to everybody. It's perfectly acceptable to use third-party packages. If somebody wants to add something to x/net/http/httpguts, that's fine too.

@bradfitz bradfitz added this to the Unplanned milestone Apr 22, 2019

@bradfitz bradfitz changed the title net/http: pre-process link header x/net/http/httpguts: add parser/accessors for Link header Apr 22, 2019

@arnottcr

This comment has been minimized.

Copy link
Author

commented Apr 22, 2019

sgtm; is there opposition to merging in something that has stabilized in golang.org/x/net, considering this is an RFC, or is the API bloat not worth the cost?

@bradfitz

This comment has been minimized.

Copy link
Member

commented Apr 26, 2019

I don't think it ever needs to live in net/http.

@bcmills bcmills added the NeedsFix label May 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.