Skip to content

Commit 15dad48

Browse files
committed
update
1 parent 720641f commit 15dad48

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

__tests__/feature-flag-client.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ describe('Feature Flag Client', () => {
140140
it('should delete feature flag', async () => {
141141
const appConfigEndpoint = 'https://example.com'
142142
const featureFlagId = 'featureFlagId1'
143-
const label = 'test-label'
143+
const label = 'test label/with special&chars'
144144

145145
const getMock = jest.spyOn(axios, 'delete').mockResolvedValue({
146146
status: 200
147147
})
148148

149149
await deleteFeatureFlag(appConfigEndpoint, featureFlagId, label)
150150
expect(getMock).toBeCalledWith(
151-
`${appConfigEndpoint}/kv/.appconfig.featureflag%2FfeatureFlagId1?api-version=2023-11-01&label=test-label`,
151+
`${appConfigEndpoint}/kv/.appconfig.featureflag%2FfeatureFlagId1?api-version=2023-11-01&label=test%20label%2Fwith%20special%26chars`,
152152
{
153153
headers: {
154154
Accept: '*/*',

dist/index.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/feature-flag-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const listFeatureFlags = async (
1717
label: string
1818
): Promise<FeatureListResponse> => {
1919
const response = await axios.get<FeatureListResponse>(
20-
`${appConfigEndpoint}/kv?key=.appconfig.featureflag*&api-version=${apiVersion}&label=${label}`,
20+
`${appConfigEndpoint}/kv?key=.appconfig.featureflag*&api-version=${apiVersion}&label=${encodeURIComponent(label)}`,
2121
{ headers: await getHeaders(appConfigEndpoint) }
2222
)
2323

0 commit comments

Comments
 (0)