diff options
Diffstat (limited to 'internal/frontend')
| -rw-r--r-- | internal/frontend/imports_test.go | 6 | ||||
| -rw-r--r-- | internal/frontend/server.go | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/internal/frontend/imports_test.go b/internal/frontend/imports_test.go index bef1934c..c130a028 100644 --- a/internal/frontend/imports_test.go +++ b/internal/frontend/imports_test.go @@ -112,7 +112,7 @@ func TestFetchImportedByDetails(t *testing.T) { pkg: pkg2, wantDetails: &ImportedByDetails{ ImportedBy: []*Section{{Prefix: pkg3.Path, NumLines: 0}}, - NumImportedByDisplay: "0 (displaying 1 package, including internal and invalid packages)", + NumImportedByDisplay: "1", Total: 1, }, }, @@ -123,7 +123,7 @@ func TestFetchImportedByDetails(t *testing.T) { {Prefix: pkg2.Path, NumLines: 0}, {Prefix: pkg3.Path, NumLines: 0}, }, - NumImportedByDisplay: "0 (displaying 2 packages, including internal and invalid packages)", + NumImportedByDisplay: "2", Total: 2, }, }, @@ -161,7 +161,7 @@ func TestFetchImportedByDetails_ExceedsLimit(t *testing.T) { {Prefix: "m2.com/a/p"}, }, - NumImportedByDisplay: "0 (displaying more than 2 packages, including internal and invalid packages)", + NumImportedByDisplay: "3 (displaying more than 2 packages, including internal and invalid packages)", Total: 3, } checkFetchImportedByDetails(ctx, fds, t, m.Packages()[0], wantDetails) diff --git a/internal/frontend/server.go b/internal/frontend/server.go index 6f4e5a9d..d6a7fa01 100644 --- a/internal/frontend/server.go +++ b/internal/frontend/server.go @@ -238,6 +238,7 @@ func (s *Server) Install(handle func(string, http.Handler), cacher Cacher, authV handle("GET /vuln/", vulnHandler) handle("GET /v1/package/", s.errorHandler(api.ServePackage)) handle("GET /v1/symbols/", s.errorHandler(api.ServePackageSymbols)) + handle("GET /v1/imported-by/", s.errorHandler(api.ServePackageImportedBy)) handle("GET /v1/module/", s.errorHandler(api.ServeModule)) handle("GET /v1/versions/", s.errorHandler(api.ServeModuleVersions)) handle("GET /v1/packages/", s.errorHandler(api.ServeModulePackages)) |
