newURLSourceForTest constructs a urlSource that bypasses the HTTPS-only and SSRF dial-time checks. It is defined here, in a _test.go file, so it is not compiled into release binaries. Tests use it because httptest.NewServer binds to 127.0.0.1 over plain HTTP.
(rawURL string, envProvider environment.Provider)
| 31 | // not compiled into release binaries. Tests use it because httptest.NewServer |
| 32 | // binds to 127.0.0.1 over plain HTTP. |
| 33 | func newURLSourceForTest(rawURL string, envProvider environment.Provider) Source { |
| 34 | return &urlSource{ |
| 35 | url: rawURL, |
| 36 | envProvider: envProvider, |
| 37 | unsafe: true, |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | func TestOCISource_DigestReference_ServesFromCache(t *testing.T) { |
| 42 | t.Parallel() |
no outgoing calls
no test coverage detected