Closed jacobbednarz closed 5 years ago
Looks like at least one of these failures is also happening on master.
$ make test
Running tests...
? github.com/cactus/go-camo/cmd/go-camo [no test files]
? github.com/cactus/go-camo/cmd/url-tool [no test files]
--- FAIL: Test404ImageLargerThan5MB (3.19s)
Error Trace: proxy_test.go:217
Error: Expected nil, but got: &errors.errorString{s:"response code = 504, wanted 404"}
Test: Test404ImageLargerThan5MB
FAIL
FAIL github.com/cactus/go-camo/pkg/camo 11.278s
ok github.com/cactus/go-camo/pkg/camo/encoding (cached)
ok github.com/cactus/go-camo/pkg/router (cached)
ok github.com/cactus/go-camo/pkg/stats (cached)
make: *** [test] Error 1
The tests currently rely on a few public servers for a couple of tests. A few of those tests sometimes fail, when the server it tests against breaks or has errors. I'll look into this one in particular and see if the test needs to be adjusted.
lgtm. Thanks!
This takes the current logic for checking whether the request is for a valid HTTP content-type and splits it into two parts. The split moves to allow differentiation between a content-type that we don't intend to proxy and a missing content-type as they should be handled differently.