Skip to content

Commit

Permalink
Addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kobelb committed Jan 27, 2020
1 parent 1014777 commit f34f9a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions x-pack/plugins/features/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ export function defineRoutes({ router, featureRegistry, getLegacyAPI }: RouteDef
{
path: '/api/features',
options: { tags: ['access:features'] },
validate: { query: schema.object({ ignoreValidLicenses: schema.maybe(schema.boolean()) }) },
validate: {
query: schema.object({ ignoreValidLicenses: schema.boolean({ defaultValue: false }) }),
},
},
(context, request, response) => {
const allFeatures = featureRegistry.getAll();

return response.ok({
body: allFeatures.filter(
feature =>
request.query.ignoreValidLicenses === true ||
request.query.ignoreValidLicenses ||
!feature.validLicenses ||
!feature.validLicenses.length ||
getLegacyAPI().xpackInfo.license.isOneOf(feature.validLicenses)
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/ui_capabilities/common/services/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class FeaturesService {
public async get({ ignoreValidLicenses } = { ignoreValidLicenses: false }): Promise<Features> {
this.log.debug('requesting /api/features to get the features');
const response = await this.axios.get(
`/api/features${ignoreValidLicenses ? '?ignoreValidLicenses=true' : ''}`
`/api/features?ignoreValidLicenses=${ignoreValidLicenses}`
);

if (response.status !== 200) {
Expand Down

0 comments on commit f34f9a6

Please sign in to comment.