Skip to content

Commit

Permalink
remove provider filter from http endpoint to registry
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed Oct 11, 2021
1 parent 8b71835 commit 3bb0ee0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 7 additions & 0 deletions internal/grpc/services/appregistry/appregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ func (s *svc) ListSupportedMimeTypes(ctx context.Context, req *registrypb.ListSu
}, nil
}

// hide mimetypes for app providers
for _, mime := range mimeTypes {
for _, app := range mime.AppProviders {
app.MimeTypes = nil
}
}

res := &registrypb.ListSupportedMimeTypesResponse{
Status: status.NewOK(ctx),
MimeTypes: mimeTypes,
Expand Down
7 changes: 0 additions & 7 deletions internal/http/services/appprovider/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,6 @@ func (s *svc) handleList(w http.ResponseWriter, r *http.Request) {
return
}

// hide mimetypes for app providers
for _, mime := range listRes.MimeTypes {
for _, app := range mime.AppProviders {
app.MimeTypes = nil
}
}

res := filterAppsByUserAgent(listRes.MimeTypes, r.UserAgent())
js, err := json.Marshal(map[string]interface{}{"mime-types": res})
if err != nil {
Expand Down

0 comments on commit 3bb0ee0

Please sign in to comment.