Skip to content

Commit

Permalink
Fix an issue with no trailing slash on the list rules endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
MytsV committed Sep 29, 2024
1 parent e552749 commit 00d9041
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { RuleDTO } from '@/lib/core/dto/rule-dto';
import { BaseStreamableDTO } from '@/lib/sdk/dto';
import { BaseStreamableEndpoint } from '@/lib/sdk/gateway-endpoints';
import { HTTPRequest } from '@/lib/sdk/http';
import { Response } from 'node-fetch';
import { convertToRuleDTO, ListRulesFilter, TRucioRule } from '../rule-gateway-utils';
import {RuleDTO} from '@/lib/core/dto/rule-dto';
import {BaseStreamableDTO} from '@/lib/sdk/dto';
import {BaseStreamableEndpoint} from '@/lib/sdk/gateway-endpoints';
import {HTTPRequest} from '@/lib/sdk/http';
import {Response} from 'node-fetch';
import {convertToRuleDTO, ListRulesFilter, TRucioRule} from '../rule-gateway-utils';

const DEFAULT_PARAMETER = '*';

Expand All @@ -18,18 +18,18 @@ export default class ListRulesEndpoint extends BaseStreamableEndpoint<BaseStream
async initialize(): Promise<void> {
await super.initialize();
const rucioHost = await this.envConfigGateway.rucioHost();
const params = {
account: this.filter?.account ?? DEFAULT_PARAMETER,
scope: this.filter?.scope ?? DEFAULT_PARAMETER,
};
const endpoint = `${rucioHost}/rules?` + new URLSearchParams(params);
const endpoint = `${rucioHost}/rules/`;
const request: HTTPRequest = {
method: 'GET',
url: endpoint,
headers: {
'X-Rucio-Auth-Token': this.rucioAuthToken,
'Content-Type': 'application/x-json-stream',
},
params: {
account: this.filter?.account ?? DEFAULT_PARAMETER,
scope: this.filter?.scope ?? DEFAULT_PARAMETER,
}
};
this.request = request;
this.initialized = true;
Expand Down

0 comments on commit 00d9041

Please sign in to comment.