Skip to content

Commit b0c7a7f

Browse files
MytsVmaany
authored andcommitted
Fix an issue with no trailing slash on the list rules endpoint
1 parent e552749 commit b0c7a7f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/lib/infrastructure/gateway/rule-gateway/endpoints/list-rules-endpoint.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { RuleDTO } from '@/lib/core/dto/rule-dto';
2-
import { BaseStreamableDTO } from '@/lib/sdk/dto';
3-
import { BaseStreamableEndpoint } from '@/lib/sdk/gateway-endpoints';
4-
import { HTTPRequest } from '@/lib/sdk/http';
5-
import { Response } from 'node-fetch';
6-
import { convertToRuleDTO, ListRulesFilter, TRucioRule } from '../rule-gateway-utils';
1+
import {RuleDTO} from '@/lib/core/dto/rule-dto';
2+
import {BaseStreamableDTO} from '@/lib/sdk/dto';
3+
import {BaseStreamableEndpoint} from '@/lib/sdk/gateway-endpoints';
4+
import {HTTPRequest} from '@/lib/sdk/http';
5+
import {Response} from 'node-fetch';
6+
import {convertToRuleDTO, ListRulesFilter, TRucioRule} from '../rule-gateway-utils';
77

88
const DEFAULT_PARAMETER = '*';
99

@@ -18,18 +18,18 @@ export default class ListRulesEndpoint extends BaseStreamableEndpoint<BaseStream
1818
async initialize(): Promise<void> {
1919
await super.initialize();
2020
const rucioHost = await this.envConfigGateway.rucioHost();
21-
const params = {
22-
account: this.filter?.account ?? DEFAULT_PARAMETER,
23-
scope: this.filter?.scope ?? DEFAULT_PARAMETER,
24-
};
25-
const endpoint = `${rucioHost}/rules?` + new URLSearchParams(params);
21+
const endpoint = `${rucioHost}/rules/`;
2622
const request: HTTPRequest = {
2723
method: 'GET',
2824
url: endpoint,
2925
headers: {
3026
'X-Rucio-Auth-Token': this.rucioAuthToken,
3127
'Content-Type': 'application/x-json-stream',
3228
},
29+
params: {
30+
account: this.filter?.account ?? DEFAULT_PARAMETER,
31+
scope: this.filter?.scope ?? DEFAULT_PARAMETER,
32+
}
3333
};
3434
this.request = request;
3535
this.initialized = true;

0 commit comments

Comments
 (0)