I just found an interesting failure in go-apt-cacher (I'm running the latest master/HEAD version).
Using the default config file (which maps ubuntu to http://archive.ubuntu.com/ubuntu), the server panics when querying http://go-apt-cacher:3142/ubuntu/
$ go-apt-cacher --loglevel debug
2017-12-19T13:19:32.594886Z 1eec099b553c go-apt-cacher debug: "request path" path="ubuntu"
panic: path must has a prefix: ubuntu
goroutine 33 [running]:
github.com/cybozu-go/aptutil/cacher.(*Cacher).download(0xc42017a240, 0x89dcc0, 0xc420420120, 0xc42043c005, 0x6, 0xc42018e200, 0x0)
/go/src/github.com/cybozu-go/aptutil/cacher/cacher.go:338 +0x142a
github.com/cybozu-go/aptutil/cacher.(*Cacher).Download.func1(0x89dc40, 0xc420400100, 0x89dc40, 0xc420400100)
/go/src/github.com/cybozu-go/aptutil/cacher/cacher.go:256 +0x62
github.com/cybozu-go/cmd.(*Environment).Go.func1(0xc4200982a0, 0xc42041a060)
/go/src/github.com/cybozu-go/cmd/env.go:133 +0x86
created by github.com/cybozu-go/cmd.(*Environment).Go
/go/src/github.com/cybozu-go/cmd/env.go:130 +0xaf
t := strings.SplitN(path.Clean(p), "/", 2)
if len(t) != 2 {
panic("path must has a prefix: " + p)
}
I don't think its adequate behavior to kill the server just because of this. go-apt-cacher should either serve the index.html of http://archive.ubuntu.com/ubuntu/ or just reply with 404.
Hi,
I just found an interesting failure in go-apt-cacher (I'm running the latest master/HEAD version).
Using the default config file (which maps
ubuntu
tohttp://archive.ubuntu.com/ubuntu
), the server panics when queryinghttp://go-apt-cacher:3142/ubuntu/
caused by a simple:
The panic is caused by the following statement in cacher/cacher.go:L338
I don't think its adequate behavior to kill the server just because of this. go-apt-cacher should either serve the index.html of http://archive.ubuntu.com/ubuntu/ or just reply with 404.